Upgrade an ASUS Chromebox – more RAM, bigger SSD, and Ubuntu

ASUS makes a pretty handy Chromebox, and it’s handy not just because it’s running ChromeOS, it’s handy because of everything you can do to the box itself.

The ASUS Chromebox is easily upgradeable, and capable of running just about any linux distribution.

The model I picked up, the M004U has the following specs:

  • Celeron 2955U (1.4GHz) 64 bit Dual core processor with 2MB L3 Cache
  • 2GB DDR3 1600 RAM with 2 slots
  • 16GB SSD HDD
  • 802.11 b/g/n dual-band wireless, Bluetooth 4.0, and gigabit ethernet
  • four USB 3.0 ports
  • Intel HD Graphics with support for dual displays
  • an SD/MMC card reader

This post will cover how to go about upgrading the hardware, and get it up and running in a dual boot mode to ChromeOS and Chrubuntu.

Here are the parts I used:

  • ASUS CHROMEBOX-M004U Desktop PC Celeron 2955U (1.4GHz) 2GB DDR3 16GB SSD HDD from Amazon
  • Crucial 8GB Kit (4GBx2) DDR3/DDR3L 1600 MT/s (PC3-12800) CL11 SODIMM 204-Pin 1.35V/1.5V Memory For Mac CT2C4G3S160BM from Amazon
  • MyDigitalSSD SC2 Super Cache 2 42mm SATA III 6G M.2 NGFF M2 SSD Solid State Drive (128GB) From Amazon

I also had a wireless Logitech k360 keyboard and mouse I could use, as well as a Samsung monitor for a display.

Getting into the Hardware

First off, you don’t need to make any kind of system image before modifying the unit, you can simply remove the installed SSD and RAM and insert your new parts and go from there. In the instructions below, you’ll make a USB stick that can be used to restore the disk to a factory fresh image of Chrome OS.

To do this, first remove the four rubber feet on the bottom of the unit. You may need to use a small flat head screwdriver to help get them off. Don’t place them anywhere sticky side down!

You’ll then find four screws underneath where the feet were, remove them. Then carefully remove the bottom of the unit. This may be a little difficult, so you may try and slip a small screwdriver in the vents to help. Don’t scratch it up or use force.

You should now be taking a look inside, and marvelling at the relative simplicity of the device!

You’ll see the RAM chip(s), which can be easily removed by opening the clips on the edges and lifting outward.

cb1

If you are upgrading the SSD, you’ll need a tiny screwdriver to remove the screw holding in the wireless/bluetooth card, which is easily identified by the two wires that connect to it. You may remove this card entirely, or do like I did and just remove the screw holding it in and it should give you enough room to install the SSD. Underneath this is the stock Sandisk SSD, which is held in by one screw on it’s far edge, so remove the screw, and pull out the SSD.

Place your new SSD in the slot, and put the tiny screw back in to hold it. Now put the wireless/bluetooth card back in place, and put it’s screw back in as well.

Now put the bottom of the case back on, put the screws back in, and put the feet back on. You’re done with the hardware upgrade!

Getting into ChromeOS

Now you’ll need to install Chrome OS onto your new empty SSD. To do this, visit this page and follow the instructions for your operating system to create a USB stick;

https://chrome.google.com/webstore/detail/chromebook-recovery-utili/jndclpdbaamdhonoechobihbbiimdgai?utm_source=gmail

This tool is a chrome extension but it creates the USB stick beautifully, just choose your chromebox model and it will install the recovery disk for you.

Now, to get started:

  1. Start your Chromebook.
  2. When the “Chrome OS is missing or damaged” screen appears, insert the USB flash drive or SD card you created into the USB port or SD card slot on your Chrome device.
  3. Wait for the Chromebook to boot up from the flash drive.
  4. Follow the instructions that appear on the screen.
  5. On successful installation of the Chrome operating system, you will be prompted to remove the USB flash drive or SD card.
  6. Remove the USB flash drive or SD card when prompted, and your Chromebook will automatically restart.
  7. You should now be able to start your Chromebook as normal.

Now you are ready to do the install of Ubuntu if you so desire. If you just want a fast ChromeOS box, you are done!

Getting into Chrubuntu

Make sure you have ethernet plugged in, or access to a wireless access point so you can download the necessary files.

Find the developer switch on your machine (it’s in a little hole on the back of the left side next to the SD slot). Very carefully press a small paper clip end into this hole and press the power button and the remove the paperclip. When it boots, press ctrl-D to turn off OS verification mode. It should prompt you to turn on Developer mode by using the paper clip again without pressing the power button. It will now boot into developer mode, and take several minutes to prepare itself.

When it has booted, hit Ctrl-D and it will come up to the setup screen, make sure your correct networking is selected. Select continue and accept the agreement.

At the sign in screen press Ctrl-Alt-F2 to get into a shell.

Login with user chronos and hit enter, …it should not ask for a password.

Become root using the command;

sudo bash

Then issue the command to boot into the development bios by default;

chromeos-firmwareupdate --mode=todev

(if you don’t do this it will erase Ubuntu on next boot. You can undo this by booting again to the shell and issuing the command; chromeos-firmwareupdate --mode=normal)

Now type the command;

reboot

When it has booted, hit Ctrl-D and it will come up to the login screen, and now press Ctrl-Alt-F2 to get into a shell.

Login with user chronos again and hit enter, it should not ask for a password.

At this point you can download custom update scripts that will install the appropriate kernel, and a choice of several flavours of linux.

To use install Chrubuntu, type the command;

curl -L -O http://goo.gl/s9ryd > s9ryd

And after it has downloaded the script, type the command;

sudo bash s9ryd

It will prompt you to choose the appropriate size in Gigabytes you wish to give to ubuntu, I gave it 100

Let the machine reboot (still into ChromeOS), it will say it’s repairing itself and reboot. Now choose the language and networking again, and at the login prompt press Ctrl+Alt+f2 to get a shell and give the username chronos (no password)

You’ll need to run the script again, so type the command;

curl -L -O http://goo.gl/s9ryd > s9ryd

And after it has downloaded the script again, you can install by using parameters, where;

  • default (ubuntu-desktop on x86, xubuntu-desktop on arm)
  • kubuntu-desktop
  • lubuntu-desktop
  • xubuntu-desktop
  • edubuntu-desktop
  • ubuntu-standard (no GUI installed)

So to install the default you would enter;

sudo bash s9ryd

or to install ubuntu-desktop lts, type;

sudo bash s9ryd ubuntu-desktop lts

Now it will run for quite a long time, depending on your connection speed. It will prompt you for locale and other settings, most users can just hit enter.

In fact, once the download starts, I highly suggest you go grab a sandwich or something, anything is better than watching the download count slowly roll around.

When it is finished, it will prompt you to reboot by hitting Enter.

You should now verify that everything is as you like it. You can switch between ChromeOS and Chrubuntu by using the following commands;

To make it always boot Ubuntu, go into Terminal and type;

sudo cgpt add -i 6 -P 5 -S 1 /dev/sda

To make boot to Chrome;

sudo cgpt add -i 6 -P 0 -S 1 /dev/sda

(if, for some reason your keyboard doesn’t work on boot, try reconnecting it)

The default Ubuntu user is user with password also set to user. Please change the password!

You’re done! You can stop here unless you need to always boot to Ubuntu, and want to write some scripts to switch envronments, or want to change the default user.

Boot to Chrubuntu, and Script switching back and forth

To always boot into chrubuntu, at the Google sign in screen press Ctrl-Alt-F2 to get into a shell.

Login with user chronos and hit enter, it should not ask for a password.

type the commands;

sudo cgpt add -i 6 -P 5 -S 1 /dev/sda
sudo reboot

Just wait for it to restart, and it will boot up into your alternate OS

To make it boot to Chrome every time;

sudo cgpt add -i 6 -P 0 -S 1 /dev/sda
sudo reboot

Note: don’t hit Ctrl-D anymore at the OS Security screen, just wait for it to come up… this for some reason didn’t work on the next boot, it did however work from then onward. It also boots up amazingly fast.

WARNING: if you switch the developer switch back off YOU WILL LOSE YOUR UBUNTU INSTALL and go back to a completely reset ChromeBox.

You may want to do yourself a favor, and set up some scripts, so that you can boot to chrome from the terminal in Ubuntu by typing chromeos, and to Ubuntu by doing Ctrl+Alt+F2 and typing ubuntu. To do this do the following steps.

When booted into Ubuntu, find your .bashrc file for the default account user, and add this to the bottom using the vi editor; (you can look up how to use vi on the web, but to put it simply, you would type vi .bashrc, scroll to the bottom, and on a empty line press the “a” key to add text, type in the line below, and when done hit escape, then type :wq to save and exit from vi)

alias chromeos='sudo cgpt add -i 6 -P 0 -S 0 /dev/sda;sudo reboot'

After you have saved the file exit the terminal by typing;

exit

now open a terminal again, and type the command;

chromeos

It should prompt for a password, you should enter user…(we’ll change it later)

Wait for it to boot after beeping, and do a Ctrl+Alt+F2 to get to the chrome shell, login with user chronos, and enter the command;

sudo vim .profile

And edit the file (hit the a key to get into insert mode just like in vi) and add:

alias ubuntu='sudo cgpt add -i 6 -P 5 -S 1 /dev/sda;sudo reboot'

Press esc to return to ‘command mode’ Press shift + z then shift + z again to save the file and return to the terminal

Type exit and press enter.

Now in Ubuntu, you can type in a terminal the command; chromeos …and you will boot into chrome …and in Chrome, you can hit Ctrl-Alt-F2 to get the shell, login as chronos, and type ubuntu to boot into ubuntu!

You won’t have to do anything when the dive is rebooted or powered up, just wait a few seconds and it will beep a couple of times, and then boot up into whatever OS was running previously.

Update: I’ve updated this post with a different RAM package, as the original RAM that was being sold got updated to only support 1.5V, and the Chromebox requires 1.35V, so the Crucial RAM listed here now is 1.35V, which works fine with this Chromebox 🙂

Wasabi Coleslaw

Wasabi Coleslaw

This light and tangy slaw combines a crisp mix of cabbage, daikon, carrots and radishes with a bright dressing of rice vinegar and spicy wasabi.

What you need

  • 1/4 cup unseasoned rice vinegar
  • 1 teaspoon low-sodium soy sauce
  • 2 teaspoons wasabi paste
  • 1 teaspoon honey
  • 4 cups very thinly sliced cabbage , preferably Napa
  • 2 cups shredded peeled daikon radish (from about 10 ounces)
  • 2 large carrots, shredded
  • 6 radishes , trimmed and thinly sliced

How to make it

  1. In a large bowl, whisk together vinegar, soy sauce, wasabi and honey.
  2. Add cabbage, daikon, carrots and radishes, and toss to combine.
  3. Refrigerate at least 15 minutes before serving to allow flavors to blend.
  4. Taste before serving and adjust flavors if necessary.

Maple Lemon Chicken

Maple Lemon Chicken

My daughter and I made this for dinner tonight and it was tasty.

One great thing with this dish is it’s easy to modify, swap the maple syrup for honey and you have a tasty honey lemon chicken dish, for example.

What you need

  • 2 tablespoons tomato paste
  • 2 tablespoons lemon juice
  • 2 tablespoons water
  • 1 tablespoon maple syrup
  • 1/2 teaspoon salt
  • 1 pound chicken thighs, cut into 2″ chunks
  • 1/4 teaspoon salt
  • 1/4 teaspoon black pepper
  • 2 tablespoons all-purpose flour
  • 1 teaspoon extra virgin olive oil
  • 1 clove of garlic, minced

How you make it

  1. In a small bowl, whisk together the tomato paste, lemon juice, water, maple syrup and 1/2 teaspoon of salt.
  2. Sprinkle the chicken pieces with 1/4 teaspoon of salt and pepper and then dust with the flour.
  3. Heat a pan over medium heat until hot and then add the olive oil and garlic, swirling the oil and garlic around the pan. If you are using skinless chicken, add an extra teaspoon of olive oil.
  4. Add the chicken in a single layer and fry undisturbed until browned on one side (about 5 minutes). If the chicken starts spattering too much, remove the pan from the heat and use a paper towel and tongs to sop up some of the extra oil.
  5. Flip the chicken over and fry the second side until the chicken is mostly cooked through (another 3 minutes).
  6. Remove the pan from the heat and use paper towels to sop up as much oil as possible.
  7. Return the pan to the heat and add the sauce. Turn up the heat and cook the sauce down until there is almost no liquid remaining and the chicken is coated with a thick layer of glossy red sauce.

Cheesy Baked Spaghetti Squash

Chili-lime chicken, beans, spaghetti squash and cheese… This is a tasty combination that we love to make.

What you need

  • 1 (3-ounce) cooked Chicken Breast, cut into chunks
  • 1 medium Spaghetti Squash (about 4 cups cooked)
  • 1 tablespoon Olive Oil
  • 1 cup Kidney Beans, drained and rinsed
  • 1 cup fresh Salsa
  • 3 tablespoons fresh Coriander, chopped
  • 1/2 cup Shredded Cheddar Cheese
  • Sea Salt & Pepper
  • 1 tablespoon Chili Flakes, optional

How you make it

  1. Preheat your oven to 425°F and line your baking sheet with parchment.
  2. Cut the squash in half, rub with inside with olive oil and sprinkle sea salt & pepper. Place face down on the baking sheet & bake for about 25-30 minutes. The edges on the inside should be a bit browned and shreds should form easily with a fork.
  3. Meanwhile, toss the chili flakes with the cheeses and stir the fresh coriander into the salsa.
  4. When the squash is ready, take it out and let it stand for 5 minutes. Turn the oven to the broiler setting. Fully shred the squash, leaving the shell intact. You will be stuffing it!
  5. Transfer the spaghetti squash to a mixing bowl. Stir in the salsa, followed by the beans and chicken. Split the mixture in half and stuff each squash shell. Top with the shredded cheese.
  6. Place them back on the same baking sheet & broil until bubbly and browned. About 3-4 minutes.

Easy Chicken Posole

This big pot of soulful Mexican-style stew can be prepared start to finish in well under an hour.

It’s ideal for feeding a crowd or for cooking ahead for the week. If you wish, have thinly sliced radishes, fresh cilantro, diced avocado and crispy corn tortilla strips on hand for garnishing.

Fish Cakes

I’m originally from Newfoundland, and fish cakes are a staple we grew up with alongside another traditional dish called fish and brews.

You can actually make this with just about any type of fish, but I prefer to use Cod, or Sole, as white fish tends to take on the flavours you cook it with.

What you need

  • 1 ½ pounds salt dried cod
  • ¼ cup butter
  • 1 small chopped onion
  • 6 cups mashed potato
  • 1 beaten egg
  • 2 tbsp dried savoury (optional)
  • 1/2 tsp black pepper
  • 1/2 tsp paprika
  • 1/2 tsp garlic powder

How to make it

  1. Simmer the cod in boiling water for about 15 minutes.
  2. Drain the water off the fish and allow the fish to cool to almost room temperature.
  3. When the fish is cool, flake it apart with a fork into small pieces.
  4. In a sauté pan, melt the butter over medium heat.
  5. Add the onions and cook until they are softened.
  6. Add the flaked fish along with the mashed potato, egg, pepper, paprika, garlic and savoury.
  7. Mix together until well combined, then form into small cakes and roll in flour.
  8. Fry the fish cakes in canola oil over medium heat until golden brown on both sides.

This is a traditional way to make it, you can also add a little hot sauce into the mixture for flavour if you wanted to.

Generate UUIDs in PHP

I’m working on a project currently where I am using UUIDs as unique identifiers. PHP doesn’t have a good UUID function for this, so I wrote one that let me generate one.

<?php
function generate_uuid() {
	return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
		mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
		mt_rand( 0, 0xffff ),
		mt_rand( 0, 0x0fff ) | 0x4000,
		mt_rand( 0, 0x3fff ) | 0x8000,
		mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff )
	);
}
?>

For anyone who doesn’t know, a UUID, or a Universally Unique Identifier is an identifier standard used in software construction, standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE).

UUIDs are meant to enable distributed systems to uniquely identify information without significant central coordination. In this context the word unique should be taken to mean “practically unique” rather than “guaranteed unique”. Since the identifiers have a finite size, it is possible for two differing items to share the same identifier. The identifier size and generation process need to be selected so as to make this sufficiently improbable in practice. Anyone can create a UUID and use it to identify something with reasonable confidence that the same identifier will never be unintentionally created by anyone to identify something else. Information labeled with UUIDs can therefore be later combined into a single database without needing to resolve identifier (ID) conflicts.

A UUID is a 16-octet (128-bit) number. In its canonical form, a UUID is represented by 32 hexadecimal digits, displayed in five groups separated by hyphens, in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four hyphens). For example:

a8d5c97d-9978-4b0b-9947-7a95dcb31d0f

There are several versions of UUIDs, in this case the function uses version 4, which is the random UUID generation. This is generally defined as follows

Version 4 UUIDs use a scheme relying only on random numbers. This algorithm sets the version number as well as two reserved bits. All other bits are set using a random or pseudorandom data source. Version 4 UUIDs have the form xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where x is any hexadecimal digit and y is one of 8, 9, A, or B (e.g., f47ac10b-58cc-4372-a567-0e02b2c3d479).

What can I do with a Raspberry Pi?

So you just got a new Raspberry Pi, maybe it was a christmas present.. Or maybe you decided to buy one for yourself and now you want to know what you can do with this little computer?

There’s a lot you can do with it, you can use it for home automation, a file server, a web server, a media streamer running XMBC, a retro gaming console or just a tiny desktop device.

I’ll get into more detail on some of what you can do in a later post (or a couple), but for now, this post is meant to give you ideas.

First, I definitely recommend having the model with 512 megabytes of RAM, as the more memory you have, the better performance you get.

One thing I like about Raspberry Pi is that the hard drive is an SD card, so essentially, you can have multiple computers on one device, so you could have a card with raspbian on it, another card for raspbmc (the XMBC system), etc.

In terms of cases, I’ve used several cases from a case built with a simply project box, to a case built with LEGO, but my favorite is the blue Raspberry Pi SAFE case from solarbotics which also can be purchased with a mount to attach to the back of a TV.

Now, some uses for the Pi:

  1. There’s a nice getting started post over at Engadget for getting your Pi up and running
  2. Retro Gaming Console:Engadget also has a nice starting point for setting up a retro gaming rig using your Raspberry Pi and some emulators
  3. Media Streaming: Raspbmc or OpenElec both work nicely for XMBC / media streaming, and can plug into any TV. Most TVs also have USB ports which can power the little computer as well. I’ve personally been preferring Raspbmc lately as it seems faster and more stable.
  4. Install the Chromium browser for better web browsing: Since your Raspberry Pi is already hooked up to your TV, why not enjoy some big screen surfing? You’ll need a better browser than Midori for this though, so try Chromium. Just drop into a Terminal and type: sudo apt-get install chromium-browser then hit Enter.
  5. Write Games: Scratch is a programming language that’s easy to get to grips with and easy to use, which makes it good for children to start learning with and for creating rich programming projects. Check out this tutorial, featuring a bonus cat.
  6. Run Firefox OS: Although still in the developmental stages, Oleg Romashin an engineer at Nokia, has managed to get Firefox OS running on the Raspberry Pi. FFOS isn’t out until next year, but check out what’s been achieved so far.
  7. BitTorrent Server: If you frequent the various Torrent sites, then why not create a dedicated lean Torrent machine? Just hook it up to your router and leave it to do its business. Full instructions, scripts and downloads come courtesy of the snapdragon:IT blog.
  8. Pi-powered Cloud Server:  Fancy building your very own cloud server? By using OwnCloud you can. Follow the instructions, and the customised script from petRockBlog and you’ll become your own cloud provider in no time.
  9. Home Automation: There’s a new product called PiFace that’s perfect for home automation. It hooks up to the RPi and allows it to detect switch states from a door sensor, a pressure pad or any number of other switch types.
  10. Raspberry Pi Cluster: Many Pi’s make light work. Check out these instructions from the University of Southampton to make a RPi Supercomputer.
  11. Make a wearable computer:  Interesting article on building a wearable Raspberry Pi, with the display on a pair of glasses and a keyboard on his arm.

As you can see, there’s a lot you can do with your Raspberry Pi, I’m just giving some examples to get started. I’ll post some more on here later as I get more ideas for the Raspberry Pi, but the 10 or s0 examples above should be enough to get your started.

Useful Pythonista Links

Pythonista is a great app for iOS that lets you get things done, and there are a lot of useful snippets out there that help make it more useful.

This post is to bring together some of those links, and I will probably update it as I add more. I’ll also tell you why they are useful..

To start, one of the most useful resources is the Pythonista forum, where other users share code for everybody to use. So check it out.

First, to make adding these snippets easier, let’s add some code to download any gist links and create a new script:

  1. Copy the code at this url: “https://gist.github.com/b0644f5ed1d94bd32805” and save it as a new script.
  2. Then go to Settings > Actions Menu and select to add the script to your actions.

Now you can copy the gist URL into your browser and then when you open up pythonista and choose “import from gist” from your actions menu, it will add the snippet as a new script.. Handy.. Very handy..

Now, let’s look at DropBox Integration.. This is handy as you can keep all your files in DropBox and sync between devices..

  1. To start, let’s add the ability to login to DropBox
  2. Once you add this script, you will have to set up an app at http://dropbox.com/developers/apps and make sure it is limited to one folder, rather than all of DropBox.

Now, let’s add the DropBox sync app

This script, when run, will sync your local copy with the copy on DropBox, and update whichever one has recent changes.

I use this to go between my iPad, iPad mini and iPhone and it works well.

I also find this script useful to it as a web server, and download files from your browser. Also, easily customized..

The author of Pythonista also posted this handy Drum Machine script that my daughter loves to play with.

I find The Down For Everyone Or Just Me script really handy when you need to check a web site.

Also, this handy script for installing short cuts via webclips is a little tricky to start out, but works well..

You can also use this script to convert any image in your clipboard into a base64 string.

Also, if you want to email images, then use this script (also good example of using email from inside pythonista).

And finally, I use this script and bookmarklet to send to pinboard for book marking.

Pythonista is growing, and as it grows, so do the useful scripts that are available.. So play with the links above, and also make sure to read the forums on a regular basis so you can get more useful scripts.

An Ajax-Include Pattern for Modular Content

Clever and useful pattern for bringing in non-essential content to a page after its iniital load. I do a good bit of this myself (although not with this particular technique).

The intesting thing to me when this is discussed in regard to mobile, as it is here, is that the “loading…” aspect of web sites and apps is one of the thing that make people like native apps so much better.

They always feel so much faster because once a view appears on screen, it’s all the—theres nothing more to load. Tradeoffs…