Skip to content

Instantly share code, notes, and snippets.

@SteffenL
SteffenL / delete_gha_workflow_runs.js
Created April 13, 2024 14:32
Delete GitHub Actions workflow runs easily from the web browser
// Quickly deletes GitHub Actions workflow runs using the GitHub web user interface using a web browser and scripting.
// Tested on 2024-04-13.
// 1. Go to a cluttered GitHub Actions workflow runs listing page,
// e.g. https://github.com/OWNER/REPO/actions/workflows/ci.yaml.
// 2. Make absolutely sure you want to delete all of the workflow runs on the currently loaded page.
// 3. Paste the following snippet into the web browser's JavaScript console.
// 4. Wait a brief moment for "Done" to appear in the console.
// 5. Reload the page or navigate to another page.
// 6. Repeat if needed.
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@SteffenL
SteffenL / patch-edid.md
Created February 17, 2024 08:46 — forked from ejdyksen/patch-edid.md
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@SteffenL
SteffenL / mod_dds_header.lua
Created January 19, 2021 12:39 — forked from hhrhhr/mod_dds_header.lua
RP6L unpacker. Usage: rp6l.lua <filename.rpack> [output_directory]
assert(_VERSION == "Lua 5.3")
-- DDS header [32]
_fourcc = 1; _size = 2; _flags = 3; _height = 4
_width = 5; _pitch = 6; _depth = 7; _mipmaps = 8
-- reserved [44]
-- 9 10 11 12
-- 13 14 15 16
-- 17 18 19
-- DDSPixelFormat [32]
uint32 u1; // magic?
uint32 u2; // version?
uint32 uncompressedSize;
uint32 compressedSize;
ubyte compressedData[compressedSize]; // zlib
// Decompression with Python:
// import zlib
// open("CharacterProfile0.sav.raw", "wb").write(zlib.decompress(open("CharacterProfile0.sav", "rb").read()[16:]))
@SteffenL
SteffenL / Dockerfile
Created February 9, 2020 09:07
Conan Server Dockerfile
FROM ubuntu:18.04
RUN apt update && apt upgrade -y && apt install -y python3 python3-pip
RUN python3 -m pip install conan
RUN groupadd --gid 1000 conan \
&& useradd --create-home --shell /bin/bash --gid conan --uid 1000 conan
RUN mkdir /home/conan/.conan_server && chown -R conan:conan /home/conan/.conan_server
USER conan
WORKDIR /home/conan
@SteffenL
SteffenL / update_appveyor_server_appsettings.py
Last active February 8, 2020 07:42
Update AppVeyor Server appsettings.json
import os, codecs, json
appsettings_path = "/etc/opt/appveyor/server/appsettings.json"
with codecs.open(appsettings_path, mode="rb", encoding="utf8") as f:
appsettings = json.JSONDecoder().decode(f.read())
# SQLite, SQL Server, PostgreSQL
db_provider = os.getenv("APPVEYOR_DATABASE_PROVIDER")
appsettings["AppVeyor"]["Database"]["Provider"] = db_provider
@SteffenL
SteffenL / Dockerfile
Last active February 9, 2020 11:56
AppVeyor Server Dockerfile
FROM mcr.microsoft.com/powershell:ubuntu-18.04
ARG APPVEYOR_VERSION=7.0.2546
RUN apt update && apt upgrade -y && apt install -y libcap2-bin lsof python3
RUN curl -LsSo appveyor-server.deb https://appveyordownloads.blob.core.windows.net/appveyor/${APPVEYOR_VERSION}/appveyor-server_${APPVEYOR_VERSION}_amd64.deb
RUN dpkg -i appveyor-server.deb
RUN /opt/appveyor/server/appveyor version
USER appveyor
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$wc = New-Object System.Net.WebClient
# Retrieve resources
New-Item -ItemType Directory -Force -Path "C:\res"
$wc.DownloadFile("https://gist.githubusercontent.com/SteffenL/913d478d4afad265e5fa8b416dfc965d/raw/2412aff8c914b3964d361038235ebae3da21c6b3/vs2019-cpp.vsconfig", "C:\res\.vsconfig")
$wc.DownloadFile("https://download.visualstudio.microsoft.com/download/pr/8ab6eab3-e151-4f4d-9ca5-07f8434e46bb/8cc1a4ebd138b5d0c2b97501a198f5eacdc434daa8a5c6564c8e23fdaaad3619/vs_Community.exe", "C:\res\vs_Community.exe")
$wc.DownloadFile("http://files.jrsoftware.org/is/6/innosetup-6.0.3.exe", "C:\res\innosetup-6.0.3.exe")
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions",
"Microsoft.Component.MSBuild",
"Microsoft.VisualStudio.Component.TextTemplating",
"Microsoft.VisualStudio.Component.VC.CoreIde",