Linux

Working WWAN on the X1 Carbon Gen 6

When I initially received my new X1 Carbon I was very excited at the new hardware. More pixels, more lumens, more cores.

After I got over my initial euphoria, I noticed that some things didn’t work, and confirmed such by a very helpful Archwiki page.

Some of the things that didn’t work include ACPI suspend-to-RAM sleep (since corrected in a BIOS update), the the fingerprint sensor (still outstanding), and the WWAN LTE Cat9 card that Lenovo seems so proud about. It has all the LTE channels you could ever want and can achieve speeds of up to 150Mbit. It’s a pity that the Linux drivers are not up to snuff.

Installing RemixOS to an internal drive

Your old pal syslinux is there to greet you

After initially running RemixOS, the new Android build for PCs, I decided that I would rather play with booting it natively from my SSD instead of from a USB device. Performance should be better, it would free my USB thumb drive up for other duties, and it would make booting more convenient.

This turned out to be a relatively simple operation. What follows is my methodology for doing that. Please note that these instructions assume you are running Linux.

Trying out RemixOS

The RemixOS boot logo

I’ve always been one for trying out new operating systems, so when I heard news about the latest desktop-conversion effort from Jide I wanted to give it a try.

RemixOS is a proprietary offering based on the work of android-x86, which aims to bring the stock Android experience to commodity PCs. RemixOS adds on interface and convenience changes to make the operating system more usable on PC hardware. This includes UI changes such as multi-windows and a classic ‘desktop’.

Finding the perfect ancillary travel device

Hackerbeach attendees at the upper dining table

As would be familiar to anybody who knows me, I’m always interested in new tech, especially when it’s running free software and portable enough to be in my every-day carry arsenal.

For the past month or so I’ve been looking at a few devices as a secondary to my laptop to carry with me. In a few weeks I’ll be joining those already there at third installment of Hackerbeach, on the Caribbean island of Dominica.

The ‘Try’ repository and its evolution

Recently (the past few years actually) we’ve been experiencing that Mercurial has problems scaling to it’s activity. Here are some statistics for example:

  • 24550 Mercurial heads (this is reset every few months)
  • Head count correlated with the degraded performance
  • 4.3 GB in size, 203509 files without a working copy

One of the methods we’re attempting is to modify try so that each push is not a head, but is instead a bundle that can be applied cleanly to any [mozilla-central](https://hg.mozilla.org/mozilla-central" target="_blank) tree.

Mozilla’s “try” repository

We have quite a bit of infrastructure around this including Tinderbox Pushlog (TBPL) and  more. This post deals with the infrastructure and problem we face while trying to scale the ’try’ repository.

A few statistics:

  • The try repository currently has 17943 heads. These heads are never removed.
  • The try repository is about 3.6 GB in size.
  • Due to Mercurial’s on-wire HTTP protocol, this number of heads causes HTTP cloning to fail
  • There are roughly 81000 HTTP requests to try per day
  • To fix problems (mentioned below), the try repository is deleted and re-cloned from mozilla-central every few months

There are a number of problems associated with such a repository. One particularly nasty one has been present through several years of Mercurial development, and has been tricky in that it is seemingly unreproducible. The scenario is something like:

Modern push notifications with Weechat and NMA

  1. Sign up for an account on www.notifymyandroid.com.  Log in, click on ‘My Account’, then ‘Generate New Key’
  2. Install the NMA Android app (around $3 USD) onto your android device.  Launch the app and login
  3. Install pynma.py and nma.py to $HOME/.weechat/python.
  4. (Optional) Symlink nma.py to $HOME/.weechat/python/autoload
  5. In weechat:
/python load python/nma.py
/set plugins.var.python.nma.apikey "$myapikey"
  1. (Optional) To inly send notifications when detached from the screen: install and load the screen_away.py, then
/python load python/screen_away.py
/set plugins.var.python.nma.only_away on

Now you too can be harassed by inane IRC highlights no matter where in the world you are!  Thankfully, the NMA Android app has a ‘quiet hours’ in case you’d rather not be woken up in the middle of the night.

Running 512 containers on a laptop

LXC is a management system for lightweight virtual machines called containers.  LXC relies on the Linux kernel for several key features including process isolation and resource limitation.  Compared to virtual machines, LXC containers have a few limitations, however none of them affect the vast majority of use cases.

My laptop (Thinkpad X220) is by no measure a speed demon, although it still has the required resources to host a seemingly arbitrarily large amount of containers thanks to a few key deduplication technologies.  Kernel Samepage Merging or KSM allows fragments of memory with identical contents to be merged together, thus freeing up memory for other uses.