Fixing Ryzen Freezes Due to C6 Power States


Finally, I figured out how to make my system stable. For about a year I had been experiencing random freezes on my new system — but not ever while using it. I would come back in the morning and try to wake up the machine and it would be frozen. Turns out the root cause is the C6 power saving states in the Ryzen core are not fully compatible with the Linux kernel. Grrrr!

I’ll detail my fix here. I got on to this solution from a thread on and implemented it following this reddit thread.

Clone the ZenStates repo:

You can find it here:

git clone

Create a Script:

I called my

if [ "${1}" == "post" ]; then

# Disable c6 coming out of sleep
/home/mike/compile/ZenStates-Linux/ --c6-disable

Make it executable:

chmod a+x

Turn it into a service:

sudo nano /etc/systemd/system/disable-c6.service

and paste:

Description=Disable C6 on boot

ExecStart=/home/dk/Ryzen/ZenStates-Linux/ --c6-disable


Start it to disable C6 if it is currently enabled…

# systemctl start disable-c6.service

And get it to run on boot

# systemctl enable disable-c6.service

Custom Resolutions for Dell XPS 13 Running Ubuntu 16.04


I upgraded from a Chromebook to the Dell XP 13 (9360). The Developer Edition comes with Ubuntu 16.04 Xenial preinstall — which I love because it means this machine is counted as a Linux laptop and not as a Windows machine.

After installing the Cinnamon Desktop and doing a dist-upgrade the screen resolution settings were lacking. I could only choose 1920×1080 and 1360×768 as my 16:9 options. The former was tiny font, the latter was comically huge. And setting the scaling to 2 on the larger resolution looked horrible.

But this is why I really do love Linux. You can, of course, choose your own resolutions. It’s easy, and one set up they are chosen through the GUI tools just like normal.

How to create modelines for custom resolution in Linux:

I started by looking up a list of 16:9 resolutions. I selected two that are perfectly divisible by 8: 1792×1008 and 1664×936.

The process for adding these resolutions comes from thom’s askubuntu answer. Use xrandr to create and add modelines. First, just run xrandr without any parameters to establish the name of your display. Mine is eDP-1


Next, use cvt to generate the modeline for your target resolution

cvt 1792 1008


Use xrandr to add that resolution and assign it to the display. Notice for the second line we get the display name from our previous xrandr use, and the mode name from inside the quotes of the cvt output.

sudo xrandr --newmode "1792x1008_60.00"  149.50  1792 1904 2088 2384  1008 1011 1016 1046 -hsync +vsync
sudo xrandr --addmode eDP-1 1792x1008_60.00

Repeat this for any other resolutions you wish to add. Now when you load up the display settings you’ll have the new resolutions to choose from.


Make It Permanent

We’re not quite done yet. You need to make sure to make the changes persistent across reboots. Create the file ~/.xprofile and save your xrandr directives there. My file looks like this:

xrandr --newmode "1792x1008_60.00" 149.50 1792 1904 2088 2384 1008 1011 1016 1046 -hsync +vsync
xrandr --addmode eDP-1 1792x1008_60.00
xrandr --newmode "1664x936_60.00" 128.50 1664 1768 1936 2208 936 939 944 972 -hsync +vsync
xrandr --addmode eDP-1 1664x936_60.00

The Two Gimp Plugins I Can’t Live Without


Every time I’m on a new machine I install Gimp for editing images. This is fairly straightforward with a simple onliner: sudo apt-get install gimp

Gimp is amazing, it can do some much and does it well. But there are two plugins for Gimp that I simply can’t live without. They are the Layer Effects plugin and the Arrows plugin. Unfortunately, every time I set up a new system I have to look up where to get the plugins and figure out how to install them. I’m putting here to have it all in one place once and for all.

Installing Layer Effects


This plugin is as old as the hills and still just as useful as the day it was published. Installation is quite easy:

  • download from the GIMP Plugin Registry. There are two other files there you won’t need
  • Save the file in your Gimp plugins directory: ~/.gimp-2.8/plug-ins/
  • Make the file executable: chmod +x
  • Close and relaunch Gimp for this to take effect
  • You will now have a new menu: Layer –> Layer Effects

Installing Arrows


If you want to point something out in an image, an arrow is a great way to do it. Although I’m not thrilled with the user-friendlyness of the Arrows plugin, it does the job if you mess with it enough and aren’t super picky.

  • Download arrow.scm from the GIMP Plugin Registry.
  • Save the file in your Gimp scripts directory: ~/.gimp-2.8/scripts
  • Close and relaunch Gimp for this to take effect
  • You will have a new entry “Arrow…” at the bottom of the Tools menu

That’s it, go forth and edit many images!

How to silence the fully charged battery chime on your Android phone


Oh Hallelujah! I finally figured out what to me seems like the easiest solution to disability the sound that is played when my Android phone is fully charged. Since this is my only telephone I don’t want to turn all the sound off at night in case of an emergency call coming in. But it wakes us up when the battery is fully charged by playing an audible chime sound. I’ve looked for a solution many times but never found one. What I came up with is to replace the audio file with an edited one that only plays silence.

If you have a rooted phone and know what you’re doing, give this a try. Of course, I’m not responsible if your device is damaged or otherwise harmed in this process.

I’m working on an LG Optimus L9 (the P769 variant) phone running Jelly Bean. Find the sound file and copy it to your computer:

adb pull /system/media/audio/ui/FullBattery.ogg .

Now edit the file to be silence. I called my new file “FullBattery_silence.ogg”. If you don’t want to edit your own file you can download mine.

adb push FullBattery_silence.ogg /sdcard/.

Log into adb shell

adb shell

Remount the system directory so that it is writeable

mount -o rw,remount -t ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/system /system

I figured this out by looking at what is listed when the command “mount” is typed (color added for your convenience):

mount | grep /system

(this is the output):
 /dev/block/platform/omap/omap_hsmmc.1/by-name/system /system ext4 ro,relatime,barrier=1,data=ordered 0 0

Get root and change directories

cd /system/media/audio/ui/

Copy the file to this directory

cp /sdcard/FullBattery_silence.ogg .

Change the name of the original file

mv FullBattery.ogg FullBattery_backup.ogg

Rename your replacement file

mv FullBattery_silence.ogg FullBattery.ogg

Set the /system file to read only and exit:

mount -o ro,remount -t ext4 /dev/block/platform/omap/omap_hsmmc.1/by-name/system /system

That does it. The sound will still be played but now it’s just a silent audio file which won’t wake you up at night!

I’m going to be on NPR Science Friday this week

npr-science-fridayI’ve been invited as a guest on NPR Science Friday this week! This is really exciting. The show is a high caliber nation radio program about all things science.

The topic of discussion will be summer science projects for kids. I’ve got a few really top-notch projects that have been my favorites over the years so I hope you’ll tune in to hear about them. You can find programming information for your local National Public Radio station here. My segment should start at about 2:15pm Central time.