Fix Chrome Black Screen on Ubuntu

I've been getting a full black screen on my external monitor on many pages in Google Chrome on Ubuntu 16.04 LTS running GNOME. The solution to this problem is to launch chrome with the --use-gl=angle flag, like so:

google-chrome --use-gl=angle

You can also edit the google-chrome.desktop file in /usr/share/applications so Chrome always launches with this flag.

Get Bose QC35 to work on Linux

I finally managed to get my Bose QC35 to play audio properly on my Linux machine with the following:

  • Ubuntu 16.04
  • GNOME 3.18.2
  • pulseaudio 8.0
  • bluetoothctl 5.37
I was getting this error when trying to switch the audio profile of my headphones to A2DP Sink:
Failed to change profile to a2dp_sink
The solution was to do the following:
  1. Create /var/lib/gdm3/.config/pulse/client.conf with the following:
    autospawn = no
    daemon-binary = /bin/true
  2. sudo -ugdm mkdir -p /var/lib/gdm3/.config/systemd/user
  3. sudo -ugdm ln -s /dev/null /var/lib/gdm3/.config/systemd/user/pulseaudio.socket

Dokku giving a "pre-receive hook declined" error on push

Dokku was giving me this error when I tried pushing my app to it:

[remote rejected] master -> master (pre-receive hook declined)

The error message is very vague and unhelpful. You can get more information by ssh-ing into your dokku instance and enabling tracing by running dokku trace on. You will then get more detailed output when you try pushing and from that you should be able to tell what exactly went wrong. In my case, my app repository included a git submodule that the dokku server did not have permission to clone.

Fixing "pkg-resources==0.0.0" pip error on Ubuntu

I ran into this error when trying to pip install from a requirements.txt file on Ubuntu: No matching distribution found for pkg-resources==0.0.0. This line is added to the requirements.txt file (if you look in the file, you'll probably see it) by the pip that comes with Ubuntu's python-pip package (also I had created the requirements.txt file using pip freeze in a virtualenv). The solution to this problem was to first uninstall the Ubuntu version of pip:

sudo apt-get remove python-pip-whl python3-pip

Then install it using easy_install: 

# install easy_install if you don't already have it
sudo apt-get install python-setuptools

# install pip using easy_install
easy_install pip

# install virtualenv using pip
pip install virtualenv

# now you can recreate the requirements.txt file
# pip install whatever dependencies you have
pip freeze > requirements.txt

Ubuntu boot slow after resizing partition

I recently resized my Ubuntu partition to move some space from a Windows partition and I noticed that, upon rebooting, the Ubuntu startup was much slower. It turns out, in the process of resizing my root partition, I had also moved my swap partition. My /etc/fstab file still had the UUID for the old swap partition (I had done the partition resizing with gparted on the Ubuntu live usb, so it did not update the fstab file). The solution was to do the following:

  1. Get the UUID for your new swap partition using sudo blkid
  2. Update the UUID for the swap partition in the /etc/fstab file (you can edit in a terminal using sudo nano /etc/fstab)
  3. Reboot and check if that solved the slow boot problem