Skip to content

Instantly share code, notes, and snippets.

@eduncan911
eduncan911 / README.md
Last active December 21, 2025 11:13
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

@ibogun
ibogun / gist:ec0a4005c25df57a1b9d
Last active February 2, 2021 13:26
Installing gcc 4.9 & g++ 4.9 on Ubuntu 12.04 OR Ubuntu 14.04
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50
sudo apt-get install g++-4.9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 50
@foosel
foosel / README.md
Last active October 4, 2024 04:21
Getting the fingerprint reader of a Thinkpad x240 to work under Ubuntu 14.04

lsusb lists the fingerprint reader in the x240 as follows:

Bus 002 Device 003: ID 138a:0017 Validity Sensors, Inc.

There exists experimental driver support for this in a fork of libfprint for vfs5011 sensors, however you'll need to compile the driver yourself. To get the fingerprint sensor to work for lightdm login, su etc, follow these steps.

  1. Install fingerprint-gui:

    sudo add-apt-repository ppa:fingerprint/fingerprint-gui
    
@kozo2
kozo2 / docker-gentoo.sh
Created May 2, 2014 16:49
gentoo docker container (on ubuntu trusty64)
sudo su
apt-get install docker.io
cd
mkdir gentoo
cd gentoo
wget http://ftp.jaist.ac.jp/pub/Linux/Gentoo/releases/amd64/current-iso/stage3-amd64-20140403.tar.bz2
tar jxpf stage3-amd64-20140403.tar.bz2
tar -c . | docker.io import - gentoo
docker.io run -t -i gentoo /bin/bash
@xaethos
xaethos / gist:3792258
Created September 27, 2012 05:06
Mocking HttpURLConnection
public class URLRequestUnit extends InstrumentationTestCase
{
private static final String API_URL =
"http://www.example.com/api/users";
public void testHttpOkay() throws Exception {
MockURLStreamHandler handler = new MockURLStreamHandler();
URL.setURLStreamHandlerFactory(handler);
UsersRequest request = new UsersRequest();
@shimarin
shimarin / hello.cpp
Created March 18, 2011 17:27
Python module using Boost
/*
* g++ `python-config --includes` `python-config --libs` -lboost_python -fPIC -shared -o hello.so hello.cpp
*/
#include <boost/python.hpp>
using namespace boost::python;
char const* greet(){
return "hello, world";
}