Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am bodil on github.
  • I am bodil (https://keybase.io/bodil) on keybase.
  • I have a public key whose fingerprint is 2D44 9044 793B 9F78 2E8B 7A0B 2374 7866 393D FC57

To claim this, I am signing this object:

@bodil
bodil / parse.js
Last active August 29, 2015 14:12
/* @flow -*- mode: flow -*- */
/*
* Example:
*
* var p = require("./parse");
*
* var parser = p.str([
* p.many1(p.letter),
* p.many(p.digit)
;;; -*- lexical-binding: t -*-
(require 'dash)
(defun var (c) (vector c))
(defun var? (x) (vectorp x))
(defun var=? (x1 x2) (= (elt x1 0) (elt x2 0)))
(defun assp (pred l)
(-first (lambda (i) (funcall pred (car i))) l))

How to put a GNU/Linux installation on your Chromebook

DISCLAIMER: This could all quite plausibly brick your Chromebook, and I take no responsibility for any damage you might inflict on it or yourself. Follow along at your own risk.

Most Chromebooks can run some flavour of GNU/Linux using the Chrubuntu method, running off the kernel that comes with ChromeOS. I found, however, that the ChromeOS kernel didn’t play well with recent X.org versions, and would refuse to recover from suspend, and not deal very well at all with having an external screen attached to it.

I also wanted to replace ChromeOS entirely with Arch on my Chromebook, because only 16 gigabytes of eMMC isn’t very convenient for dual booting. To accomplish this, I needed an external installation medium.

First of all, you’ll need to get your Chromebook into developer mode if you haven’t already. This is model specific, although for most recent models holding the Escape and Reload keys while booting should do the trick. If not, ask Google.

Notes: Arch Linux on Chromebook Pixel 2015

To install another OS, follow the instructions at https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices/chromebook-pixel-2015 to enable developer mode, after which you should be able to hit Ctrl+L on the boot screen to launch SeaBIOS, which will boot external media (BIOS only, not GPT). You’ll be able to boot the Arch installation image from a USB stick using this.

Currently, I’ve got GRUB running off an SD card, which I boot using SeaBIOS. My system is installed on the internal drive, but GRUB won’t work from there. My technique at https://gist.github.com/bodil/b14a398189e5643ee03e has so far failed to yield a booting kernel on the internal drive, which is somewhat annoying, but as I keep the SD card permanently inserted anyway, it hasn’t been bothersome.

Arch has a wiki page on the Pixel 2015: https://wiki.archlinux.org/index.php/Chromebook_Pixel_2

The stock kernel (as of 4.0.5) lacks support for some h

@bodil
bodil / package.json
Last active September 21, 2017 13:18
Who needs Pulp anyway?
{
"name": "lol",
"version": "1.0.0",
"main": "index.js",
"config": {
"main": "Main",
"testMain": "Test.Main"
},
"scripts": {
"compile": "psc -c -f 'src/**/*.js' -f 'bower_components/purescript-*/src/**/*.js' 'src/**/*.purs' 'bower_components/purescript-*/src/**/*.purs'",

Keybase proof

I hereby claim:

  • I am bodil on github.
  • I am bodil (https://keybase.io/bodil) on keybase.
  • I have a public key ASAhOfE9MM6Kez7pDhD-sZvig7dr5jTYIwXBtuMHS32ZtQo

To claim this, I am signing this object:

@bodil
bodil / fix-my-stupid-folio.service
Created November 24, 2016 15:05
Hacks for Linux kernel glitches on the HP Elitebook Folio G1
[Unit]
Description=HP Elitebook Folio G1 fixes
[Service]
ExecStart=/sbin/fix-my-stupid-folio
[Install]
WantedBy=basic.target
// Largely copied (with some modernisation applied) from:
// https://github.com/reem/rust-lazy/blob/master/src/single.rs
use std::cell::UnsafeCell;
use std::ptr;
use std::ops::{Deref, DerefMut};
use self::Inner::{Evaluated, EvaluationInProgress, Unevaluated};
pub trait Invoke<A = (), R = ()> {
@bodil
bodil / bool.rs
Last active February 28, 2021 03:50
Simple type level natural numbers in Rust
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct True;
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct False;
pub trait Bool {
fn new() -> Self;
}
impl Bool for True {