Skip to content

Instantly share code, notes, and snippets.

@RLovelett
RLovelett / libvirt.md
Last active March 8, 2023 01:53
Setup libvirtd on Fedora Server 28

libvirtd Fedora 28

System Packages

$ dnf install -y \
    libvirt \
    libvirt-python \
    libguestfs-tools \
 qemu-kvm \
@RLovelett
RLovelett / mtoc.sh
Created October 29, 2019 20:50
Compile mtoc on macOS Catalina Xcode 11
# https://github.com/macports/macports-ports/blob/master/devel/cctools/Portfile
curl -o cctools-921.tar.gz https://opensource.apple.com/tarballs/cctools/cctools-921.tar.gz
curl -o llvm-8.0.1.src.tar.xz https://github.com/llvm/llvm-project/releases/download/llvmorg-8.0.1/llvm-8.0.1.src.tar.xz
curl -o ld64-409.12.tar.gz https://opensource.apple.com/tarballs/ld64/ld64-409.12.tar.gz
tar xvf cctools-921.tar.gz
tar xvf llvm-8.0.1.src.tar.xz
tar xvf ld64-409.12.tar.gz
@RLovelett
RLovelett / README.md
Last active March 18, 2020 22:01
Systemd Unit and Timer to Build Swift Everyday

Swift Toolchain Build

These systemd unit and timer configurations will get an up-to-date copy of Swift and build the toolchain every day at 2:00 AM local time.

Prerequisites

In order for these configurations to work without modification it is assumed that all of the development dependencies are already installed and that the Swift repository is cloned in $HOME/Source/swift-source/swift.

Install

@RLovelett
RLovelett / README.md
Last active November 8, 2024 11:08
Force RGB instead of YCbCr output for HDMI on Ubuntu

Force RGB pixel format over YCbCr

There are some monitors, in my case Dell U2413, that report having YCbCr support when plugged in over HDMI. My AMD Radeon RX 570 Series video card sees this YCbCr pixel format and then prefers that over the RGB pixel format. The result is that fonts, graphics and other visuals are pixelated and not smooth in Ubuntu.

This actually is not just a Linux problem. A similar problem exists on macOS with the same monitor hooked up over HDMI. In fact an article by John Ruble on the Atomic Object blog called Fixing the External Monitor Color Problem with My 2018 MacBook Pro attempts to fix the exact same thing.

Solution

All of the articles I could find exploring this topic advocate patching the EDID for the monitor. Unfortunately the macOS solution would not work here. Luckily I found a Reddit post that covered how to get it working.

@RLovelett
RLovelett / README.md
Last active February 26, 2023 09:40
FT232H user space GPIO device - https://stackoverflow.com/q/60781594/247730

Setting up ftrace

$ sudo su - root
$ cd /sys/kernel/debug/tracing
$ cat available_tracers
hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop
$ cat available_filter_functions | grep ftdi_sio | cut -d' ' -f1 | tr '\n' ' ' > set_ftrace_filter
$ cat set_ftrace_filter
get_serial_info [ftdi_sio]
@RLovelett
RLovelett / CMakeLists.txt
Created April 1, 2020 17:59
Example of preferring Python 2 over Python3 with new FindPython2 and FindPython3 CMake modules
cmake_minimum_required(VERSION 3.12.4)
find_package(Python2 COMPONENTS Interpreter)
find_package(Python3 COMPONENTS Interpreter)
if (NOT Python2_Interpreter_FOUND AND NOT Python3_Interpreter_FOUND)
message(FATAL_ERROR "Could NOT find Python2 or Python3")
endif()
# https://github.com/Kitware/CMake/blob/cfc92b483fbd3695d4a67843977e709ba4d7ea47/Modules/FindPython/Support.cmake#L2433-L2439