I’m looking for a laptop for side-projects, mostly server-side.
I’ve been using a Web-based editor at work, which makes my Macbook feel like a glorified netbook.
The 15” Macbook is great, but $2500 is steep for my needs. I think an actual netbook would be sufficient, but I have little experience w them.
I like Chromebook’s simplicity. The Pixelbook seems well-designed, but it’s pricey. Looking around, $500 seems like a reasonable experiment.
At this point I’m looking for a Chromebook with:
- High ratings in general (crowd wisdom)
- Close to Pixelbook specs
- Close to 15” screen
- Support for Android, so I can use 1Password
- USB ports (so I can charge my phone :)
The Acer Chromebook 14 is highly rated on Amazon, provides 4GB ram, 32GB storage, USB 3, Wi-FI AC, HD video, supports Android and costs ~$300, and I can pick it up immediately at a local BestBuy, which provides a surprisingly nice Instacart-like experience.
Acer is the genus of trees containing maples :) 🍁
The keyboard, esp the space bar, is flaky compared w a mac. (On the upside, it’s improving my touch-typing :)
After using the chromebook for a few months, 4GB is just enough. It’s great for having a few Chrome tabs open. But jumping between a dozen, esp email and slack, with a few different apps running, esp video conference, pushes the limits.
Android interop is great, but not all apps work well. For example, 1Password is fine, but Slack is crashy. Also, not all apps are compatible, ie just because I have an app on my phone doesn’t mean it can be installed on my chromebook. I’d guess the same would be true with a tablet.
Now that I have a screen, keyboard and internet connection, I need a machine to develop on. A colleague recommended Cloud9, which layers a Web-based IDE on EC2.
I have little experience with AWS, but Amazon estimates the cost at ~$2/mo, which also seems like a reasonable amount to experiment with. I created a budget for $10/mo just in case.
Cloud9 provides an “auto-hibernation” setting to save cost. This appears to stop the associated EC2 instance. Opening the IDE after manually stopping the instance restarts it.
Cloud9 configures EC2 and EBS, but I remember seeing a doc mention security is still our responsibility. The Node docs describe an easy way to stay up to date:
sudo yum -y update.
Aside: the Lambda editor seems like a simplified Cloud9 IDE 🤔
Setting up Cloud9 was straightforward. Kudos to that team for a great product, and AWS for integrating it well.
The past couple months’ AWS bills are around $1, mostly for EBS (The OS alone is 4GB).
This whole plan of using a chromebook + cloud really shines wrt dynamic resource changes, ie as compared w upgrading hardware. I’ve been playing around with large data sets recently using Anaconda, and ran out of storage with the default Cloud9 configuration (8GB). Upgrading the EBS “volume” to 16GB was fast and easy (once I found it):
- open the EC2 console
- stop the EC2 instance created by Cloud9
- in the left column, find Elastic Block Store > Volumes
- ctrl click on the volume and select modify
Cloud9 provides a terminal, but I also wanted to play around with Secure Shell (with “open as window” enabled, so I can use ctrl-w and have more conventional alt-tab navigation). Here’s what worked for me:
- Use the Cloud9 terminal to generate an SSH key pair in your ~/.ssh dir (we can also use this key for github, bitbucket, etc; I use the default id_rsa name and omitted the passphrase):
ssh-keygen -t rsa -b 2048 -v
- Enable read permissions on the private key:
chmod 400 id_rsa
Authorize the public key (Cloud9 also maintains a key there, so don’t clobber the file):
echo "`cat id_rsa.pub`" >> ~/.ssh/authorized_keys
- Download both keys (id_rsa and id_rsa.pub) by control-clicking on the files in Cloud9’s file tree and selecting “download”
- Grab public DNS hostname from the EC2 console, eg ec2-51-88-231-95.us-west-2.compute.amazonaws.com (Note this changes every time the instance stops, eg via Cloud9 hibernation.)
- In Secure Shell, specify the Cloud9 user (“ec2-user”) and hostname copied above, and import both the public and private key. (The identity field should change from “default” to “id_rsa”.)
It took me awhile to figure out how paste text into Secure Shell: two-finger tap.
I’d like to explore Android development using this set up.
The first step is setting up remote desktop, so I can run Android Studio and an emulator.
Create instance with window manager
I like Ubuntu, and there’s lots of support for it. The AMI browser on ubuntu.com makes it easy to find an LTS (stable version) backed by HVM (recommended by EC2 docs) EBS (like Cloud9’s configuration) in my region (close by for low latency).
EC2’s getting started docs do a good job explaining how to set up an instance with sane defaults. One caveat: I was able to launch an instance as documented, but if I tried to reuse the pub key created above, the instance never acquired a public IP. So, it seems I need to use an EC2 key pair, which requires a bit of finagling as chromebook’s SSH app requires a private key with restricted permissions and a public key, but EC2’s key pair generation only provides a private key with open permissions. Workaround:
- Create a key pair and download the .pem file as instructed. (I’ll use “admin” as a name here per the docs recommendation to create an “Administrator” account.)
- Open the admin.pem file using chromebook’s Text app and copy the contents
- In the Cloud9 terminal
- Create a new file ~/.ssh/id_rsa and paste the .pem contents into it
- Restrict permissions (
chmod 400 ~/.ssh/id_rsa) and download as described above
- Generate a public key (
-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub) and download that too
- In the chromebook, import these keys into the SSH app as described above
- SSH into the ubuntu instance using the username “ubuntu”, ie as opposed to “ec2-user” for Amazon Linux.
Install Chrome Remote Desktop (CRD)
The CRD docs are pretty good, but assume you already have a desktop with Chrome running. For EC2, we need a way to bootstrap without a desktop. A couple (1, 2) Chrome support threads were helpful. Steps:
Install a window manager:
$ sudo apt-get install xfce4
Download the CRD installer and install:
$ wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb ... $ sudo dpkg -i chrome-remote-desktop_current_amd64.deb
exec /usr/sbin/lightdm-session "startxfce4"
Restart CRD to load the config:
$ sudo /etc/init.d/chrome-remote-desktop restart
Authenticate, register the host and set an access pin:
Note: this step directs you to a url, which redirects to another url. The auth token is a query param of the redirect url.
- Install the CRD extension on the chromebook and launch it. You should see your host listed in the “my computers” section.
- Click on your host and enter the access pin you defined
Now I need a place to persist source code. Bitbucket provides free private repos. After generating an SSH key pair in Cloud 9’s terminal and adding the public key to my Bitbucket account Git works as expected. Cloud9 automatically persists to EBS, so the key pair survives hibernation.
To simplify SSH passphrase usage, I had to run
eval "$(ssh-agent)" and then
ssh-add after each restart.
- In Cloud9 IDE, create express server
- In EC2 console,
- Create a security group with a “Custom TCP Rule” exposing port 3000
- Add this security group to the instance created by Cloud9
- Note instance’s “Public DNS” hostname
- In browser, load host with scheme http and port 3000
After a day of experience, setting things up and drafting this post, I’m pleased with the set up. Seems like a success so far.