Ok – my new best friend is Chromebrew – a lightweight package manager that lets you run linux programs in Chromebook developer mode without having to install a whole operating system.
I needed it because (a) I develop and deploy code from my chromebook using github and Google’s Cloudshell virtual linux machine and (b) lately, Cloudshell has not been reliably available.
Here is what I needed to learn and do:
- Get my chromebook into developer mode, which on my machine (Acer C740) requires holding esc-Refresh and hitting the power key. That gets you to the Recovery Screen. Hit Ctrl-D (there’s no prompt). It will ask you to confirm, then reboot into dev-mode. Eventually it will show the scary boot screen and you just hit Ctrl-D again.
- Enter crosh (the terminal) with Ctrl-Alt-T and type shell.
- Learn how to copy and paste – inside crosh you use Ctrl-Shift-C and V instead of just Ctrl-C and V.
- Install chromebrew via curl -Ls git.io/vddgY | bash
- Install gcloud via: > crew install google_cloud_sdk
- > gcloud install
- > gcloud components update
- Next I had to figure out where I could put my source code for my project. The only folders you can write in are either /usr/local and ~/Download. The latter has a huge advantage because the caret editor already installed will work in that area. I tried >crew install nano but nano was very “jumpy” running in the shell tab.
- I also loaded two nice Chrome extensions from the webstore – Secure Shell and an app that launches your crosh shell in a window.
- > cd ~/Download
- > git clone https://github.com/youraccount/yourproject.git – which puts it in the folder ~/Download/yourproject
- Now if you try “gcloud deploy” it won’t work. You have to do
- cd yourproject
- > gcloud beta deploy ./app.yaml –project=yourproject –version=1
- The first time you run it it will load additional stuff into gcloud but not thereafter.
- Just for fun, I also tried >crew install php and chose the latest version. This is really handy because php includes its own webserver – you can do >php -S localhost:8000 which you can use to test your app from your chrome browser. It includes sqlite which – if you code using pdo – you can even try out things you will later run in mysql.