Skip to content

Instantly share code, notes, and snippets.

@Brainiarc7
Brainiarc7 / skylake-tuning-linux.md
Last active February 21, 2025 01:29
This gist will show you how to tune your Intel-based Skylake, Kabylake and beyond Integrated Graphics Core for performance and reliability through GuC and HuC firmware usage on Linux.

Tuning Intel Skylake and beyond for optimal performance and feature level support on Linux:

Note that on Skylake, Kabylake (and the now cancelled "Broxton") SKUs, functionality such as power saving, GPU scheduling and HDMI audio have been moved onto binary-only firmware, and as such, the GuC and the HuC blobs must be loaded at run-time to access this functionality.

Enabling GuC and HuC on Skylake and above requires a few extra parameters be passed to the kernel before boot.

Instructions provided for both Fedora and Ubuntu (including Debian):

Note that the firmware for these GPUs is often packaged by your distributor, and as such, you can confirm the firmware blob's availability by running:

@piraz
piraz / monitor_service.py
Last active April 6, 2022 02:58
Script that monitors a service running on systemd. If service is not running the script will try to start the service.
#!/bin/python
#
# Copyright 2016 Flavio Garcia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@ndrhzn
ndrhzn / getcolor.py
Last active December 10, 2017 22:16 — forked from zollinger/getcolor.py
Simple way to get dominant colors from an image in Python
import Image, ImageDraw
def get_colors(infile, outfile, numcolors=10, swatchsize=20, resize=150):
image = Image.open(infile)
image = image.resize((resize, resize))
result = image.convert('P', palette=Image.ADAPTIVE, colors=numcolors)
result.putalpha(0)
colors = result.getcolors(resize*resize)
//
// Arduino serial-interface for controlling the ws2812 leds. The serial interface is based on the
// Adalight protocol. The protocol is as follows:
// [prefix][led count][checksum][red, green, blue]*
// prefix := 'Ada'
// led count := number of leds - 1 (uint16_t big endian)
// checksum := led count high bit XOR led count low bit XOR 0x55 (uint8_t)
// red, green, blue := channel intensity [0-255] (uint8_t)
//
@jmb
jmb / README.md
Last active January 27, 2019 22:25
MQTT Data Subscriber for Dashing

Description

Dashing job to subscribe to MQTT messages.

MQTT is a lightweight publish/subscribe messaging transport. This job allows Dashing to subscribe to these messages and send them as events. There is no associated widget as the data can take any form - commonly numbers, but not necessarily. The script as laid out below sends events with value, current (the same contents) and last values so can be plugged directly into the Numbers or Meter widgets using the data-id in the dashboard file. The send_event could easily be modified if required.

Set up

Add to Gemfile:

@bullshit
bullshit / README.md
Last active January 29, 2020 07:20
LIRC patch instruction/how-to for USB Infrared Toy from Dangerous Prototypes

LIRC patch instruction/how-to for USB Infrared Toy from Dangerous Prototypes

This is a instruction to patch the usb infrared toy driver into lirc sources. Most of the work is done by Peter Kooiman

Requirements

@scottgwald
scottgwald / requirements.txt
Last active November 10, 2017 22:24
wmctrl in python
gevent
wmctrl
@blackjid
blackjid / README.md
Last active June 11, 2023 15:15
How configure your raspberry pi with dashing to have a awesome dashboard

Raspberry pi dashboard

This is what we did to setup a few dashboards at platanus

You'll need

  • Raspberry Pi
  • Dashing Service
  • Wifi stick (optional)
@blacktm
blacktm / install_ruby_rpi.sh
Last active November 28, 2024 20:35
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install
@mxpr
mxpr / dashing-requests.py
Created December 15, 2013 17:22
Example of how to send data to dashing from python
# http://stackoverflow.com/questions/20211990/sending-data-curl-json-in-python
import requests #pip install requests
import simplejson as json #pip install simplejson
url = "http://<ip-address>:3030"
widget = "welcome"
data = { "auth_token": "YOUR_AUTH_TOKEN", "text": "Python Greetings!!" }
fullUrl = "%s/widgets/%s" % (url, widget)