Ubuntu on a Dell XPS 15 9550

I have enjoyed using a Dell XPS 15 9550 for a few months now. Fantastic machine. When I got it, I tried to install Ubuntu 15.10 which utterly failed. Basically, I couldn’t even boot up the installation. I gave up and started monitoring threads on that subject.

Today is the release of Ubuntu 16.10 and I thought I’d give it a try once more. Well, good on me as it worked flawlessly! For those interested, here’s what I did:

  1. Updated, from Windows, the BIOS to 1.2.14 as well as the drivers for the Dell WD15 dock station (since I own one)
  2. Disabled the Secure Boot in the BIOS and rebooted
  3. Switched from RAID to AHCI from Windows drivers for the storage (really make a recovery disk just in case) following this link. Windows didn’t reboot after I changed the driver type from Device Manager. But, rebooting in safe mode, and then rebooting fixed that automatically somehow (see this comment). You have to switch to AHCI or Ubuntu will not see your storage during installation
  4. Next booted on my USB key and executed the installation process

That’s it!

Once installed and restarted, I could boot on both Linux and Windows fine. Once logged into my Ubuntu session, I installed the Nvidia drivers (367.57) via the Ubuntu driver utility, then Cinnamon because it handles HDPi automatically and I dislike Unity with a passion.

Everything has been working fine so far (natively without any tweaking):

  • HDPi on the 4K screen
  • Keyboard backlight
  • Touchscreen
  • Bluetooth
  • Wifi
  • Dual screen (HDMI)
  • Logitech C920

I haven’t tried yet or I’m not sure:

  • Hibernating
  • Sleep mode
  • the dock station (it was recognised but did not use it properly yet)

 

There is hope!

Managing your process with the CherryPy’s bus

CherryPy is a successful small web framework which over the years has built up its performances as well as its stability. To do so, Robert Brewer, the main CherryPy’s architect has introduced what is called the Web Site Process Bus (WSPBus). The idea is to manage a Python process by providing it with a bus to which one can publish or subscribe for events. CherryPy’s implementation of the bus comes with a set of pubsub handlers for very basic operations such as responding to system signals, handle thread creation and deletion, drop process privileges and handle PID files. The bus mechanism can help your handling of sub-processes so that they start, run and terminates gracefully. Let’s see how.

Create your bus

First, you need to create a bus instance. This could be as simple as this.

If you want to log through the bus, you will need further work since the bus doesn’t create a logger by default. Let’s see an example.

Not much, just creating a logger and subscribing the bus log channel to an instance method.

Associate the bus with the main process

Before we move on to the management of sub-process, let’s see how we can manage the main Python process already with our bus above.

For this, let’s imagine a bank placing stock orders, those orders will be handled by a broker running in a sub-process.

As you can see, not much again here, we simply associate a bus with the bank object. We also register to the exit channel of the bus so that when we terminated, we can do some cleanup. It’s good use to unregister from the bus.

We don’t actually care where those orders come from so we randomly generate them. The orders are placed every time the bus iterates its loop. This is done by attaching to the main channel of the bus.

We use a process queue to communicate with the broker’s sub-process.

Associate the bus with a sub-process

Handling the sub-process is actually similar to handling the main process. Let’s see the broker implementation for example.

Several things are to be noticed. First we register once again to the bus’ main channel a method that checks the shared queue for incoming data. Whenever the incoming message is “stop”, we exit the bus altogether, thus leaving the sub-process, since it was blocked on the bus loop.

Note that the stop method could be called by the parent process if you needed to programatically stop the sub-process.

Put it all together

Run the code above as follow:

This creates the shared queue, starts the sub-process that runs the broker and finally starts the bank within the main process.

You should see a bunch of messages in the console and if you hit Ctrl-C, this will stop both processes cleanly.

And here we are, we now manage processes and sub-processes with a clean solution. The CherryPy process bus is an elegant add-on to your toolbox that I can only highly advise to consider in the future. The WSPBus implementation is part of the main CherryPy package (CherryPy 3.x), so you’ll have to install it all, even if you don’t require the HTTP framework. But don’t let that hold you back since the HTTP framework isn’t required for the bus to be used.

Happy coding!

The code is here.

Is the RIAA backing down?

Via JoelFightsBack‘s twitter, “Is the RIIA backing down?” we can read:

Mr. Bainwol said that while he thought the litigation had been effective in some regards, new methods were now available to the industry. “Over the course of five years, the marketplace has changed,” he said in an interview. Litigation, he said, was successful in raising the public’s awareness that file-sharing is illegal, but now he wants to try a strategy he thinks could prove more successful.

No shit!

Like, huh, I don’t know, larger, better and cheaper legal platforms to purchase music? Your business model has been dead for years guys… now you wake up? Well never too late as they say…