Skip to content

Instantly share code, notes, and snippets.

View daryltucker's full-sized avatar

Daryl Tucker daryltucker

  • Neo-Retro Group
  • Salem, Or
View GitHub Profile
@Brainiarc7
Brainiarc7 / skylake-tuning-linux.md
Last active March 30, 2024 16:01
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:

@yellowcrescent
yellowcrescent / Makefile
Created December 11, 2016 03:35
makefile for pinger thing
# Trying to build a fucking makefile
# jacob AVR makefile
#BUILDNAME=BLINKTEST
BUILDNAME=PINGER-2016
## Program names
CC=avr-gcc
CXX=avr-g++
OBJ2HEX=avr-objcopy
@Brainiarc7
Brainiarc7 / transient-clustering-gnu-parallel-sshfs.md
Last active April 21, 2024 05:16
How to set up a transient cluster using GNU parallel and SSHFS for distributed jobs (such as FFmpeg media encodes)

Transient compute clustering with GNU Parallel and sshfs:

GNU Parallel is a multipurpose program for running shell commands in parallel, which can often be used to replace shell script loops,find -exec, and find | xargs. It provides the --sshlogin and --sshloginfile options to farm out jobs to multiple hosts, as well as options for sending and retrieving static resources and and per-job input and output files.

For any particular task, however, keeping track of which files need to pushed to and retrieved from the remote hosts is somewhat of a hassle. Furthermore, cancelled or failed runs can leave garbage on the remote hosts, and if input and output files are large, sending them to local disk on the remote hosts is somewhat inefficient.

In a traditional cluster, this problem would be solved by giving all nodes access to a shared filesystem, usually with NFS or something more exotic. However, NFS doesn't wo

@Brainiarc7
Brainiarc7 / ffmpeg-multi-instances-xargs.md
Last active July 7, 2023 08:32
This gist will show you how to launch multiple ffmpeg instances with xargs, very useful for NVIDIA NVENC based encoding where standard GPUs limit the maximum simultaneous encode sessions to two.

Spawning multiple ffmpeg processes with xargs:

On standard NVIDIA GPUs (Not the Quadros and Tesla lines), NVENC encodes are limited to two simultaneous sessions. The sample below illustrates how to pass a list of AVI files to ffmpeg and encode them to HEVC on two encode sessions:

$ find Videos/ -type f -name \*.avi -print | sed 's/.avi$//' |\
  xargs -n 1 -I@ -P 2 ffmpeg -i "@.avi" -c:a aac -c:v hevc_nvenc "@.mp4"

This will find all files with the ending .avi in the directory Videos/ and transcode them into HEVC/H265+AAC files with the ending .mp4. The noteworthy part here is the -P 2 to xargs, which starts up to two processes in parallel.

@kinifi
kinifi / index.html
Created November 26, 2016 21:31
Minecraft Overviewer has a google API key error. Here is how to fix it
<!DOCTYPE html>
<html>
<head>
<title>{title}</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Minecraft-Overviewer {version}" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
@MightyPork
MightyPork / usb_hid_keys.h
Last active May 1, 2024 05:11
USB HID Keyboard scan codes
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@Brainiarc7
Brainiarc7 / ffmpeg-howto-localfiles-manipulation.md
Created July 25, 2016 13:43
This is a standard how-to for FFmpeg's usage with local files and streams. Small hand-book detailing common encode scenarios in a standard workflow.

Standard FFmpeg How-to

Table of Contents

* Generic Syntax

* Main Options

* Encoding :
@tvlooy
tvlooy / unit.sh
Last active February 4, 2024 04:20
Bash test: get the directory of a script
#!/bin/bash
function test {
MESSAGE=$1
RECEIVED=$2
EXPECTED=$3
if [ "$RECEIVED" = "$EXPECTED" ]; then
echo -e "\033[32m✔︎ Tested $MESSAGE"
else
@daryltucker
daryltucker / linux_kernel_compile.mkd
Last active August 29, 2015 14:05
Compiling a new Kernel using old configuration.

Copy current kernel configuration to linux source

cp -vi /boot/config-`uname -r` .config

Decide about new kernel options

Use the following if you wish to only build modules for devices currently in use/connected. For example, if you don't have any usb_storage devices, you won't be able to plug in usb drives.

make localmodconfig

Compile the kernel

make -j6

Compile kernel modules

@codenamezjames
codenamezjames / floatdiv.js
Created June 12, 2014 20:18
add the class "magic-floating-stuff" to any bootstrap column and it will follow your screen when you pass it
$(function(){
var MFS = $('.magic-floating-stuff')
var ogScrollTop = $('body').offset().top,
ogElementOffset = MFS.offset().top,
ogDistance = (ogElementOffset - ogScrollTop);
MFSheight = MFS.outerHeight()
documentHeight = $(document).outerHeight()
$('body').change(function(){
MFSheight = MFS.outerHeight()