Skip to content

Instantly share code, notes, and snippets.

View eduncan911's full-sized avatar

Eric Duncan eduncan911

View GitHub Profile
When I put the reference implementation onto the website I needed to
put a software license on it.
And I looked at all the licenses that were available, and there were a lot
of them. And I decided that the one I liked the best was the MIT License,
which was a notice that you would put on your source and it would say,
"you're allowed to use this for any purpose you want, just leave the
notice in the source and don't sue me."
eduncan911 /
Last active July 10, 2023 21:12
Fixing Thermal Throttling on Thinkpad P1 and X1 Extreme - Linux Edition

Fixing Thermal Throttling on Thinkpad P1 and X1 Extreme - Linux Edition

Lenovo messed up with the X1E and P1 Gen 1 versions (and maybe later generations) in that the system boots with a thermal limit (aka Tjunction or tjmax) set to 82C (some report 80C). What this means is that regardless of power draw or under-volting settings, when your CPU hits 82C, it will drop the frequency down to the "Configurable TDP-down" frequency, or even lower. It will also may limits the system power draw.

Thermal Paste and Stress Testing

eduncan911 /
Last active July 6, 2023 20:06
Plex + Docker + Updated Chromecast Ultra Config
#!/usr/bin/env bash
# Plex's profile for Chromecast is too conservative and only plays 1080p on
# the Chromecast Ultra UHD device (4k).
# This script will download an updated Chromecast definition and start a Plex
# docker container, binding a few local paths of where you run this script.
# You may want to refer to the Official Plex Docker repository and read the
# README text:
eduncan911 / gnome-install-extensions
Last active July 25, 2019 22:43
Gnome: Manually add several Extensions (or, for those that don't trust browser extensions)
#!/bin/bash -e
# A script to mass install Gnome extensions from a single folder.
# for global extensions, use /usr/share/gnome-shell/extensions/
eduncan911 /
Created February 6, 2018 17:17

Keybase proof

I hereby claim:

  • I am eduncan911 on github.
  • I am eduncan911 ( on keybase.
  • I have a public key ASCm86SHMqJZdxyA3BUcpZKRZ8FKk7y93384uEKOOA1SZAo

To claim this, I am signing this object:

eduncan911 /
Last active July 20, 2023 09:41
Revert Gist Commits

Revert / Undo a Gist Commit

It was not exactly obvious. Here's how to revert a Gist commit!

Checkout the gist like a normal git repo:

# replace the Gist ID with your own
git clone

Treat it like a normal repo. Edit, force push, etc.

eduncan911 / main.go
Created June 9, 2016 19:56
Labels in GoLang
package main
import "fmt"
Here's a use of labels in Go to continue a for loop
from within another for and within a switch case.
func main() {
eduncan911 / go-build-all
Last active April 11, 2024 07:14
Go Cross-Compile Script
# GoLang cross-compile snippet for Go 1.6+ based loosely on Dave Chaney's cross-compile script:
# To use:
# $ cd ~/path-to/my-awesome-project
# $ go-build-all
eduncan911 / json_indent.go
Created March 1, 2016 22:25
/*Package main is a simple test of Json Identing (aka pretty print)
To run:
$ go run main.go
"eventId": "xyz",
"articleId": "123"
eduncan911 / godoc2md-all
Last active June 20, 2018 07:30
Godoc2md for current and all sub-directories
# bash script to create a GoLang in the current and all sub-directories.
# installation:
# place this in your ~/bin or similar. make sure to: chmod 755 godoc2md-all
# it is recommended to have a doc.go for each package, that allows for samples and
# additional instructions.