View plot-wpt-compat.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Instructions: | |
# 1. Checkout: https://github.com/Ecosystem-Infra/wpt-results-analysis.git | |
# 2. cd compat-2021 | |
# 3. Edit main.js like this: | |
# const CATEGORIES = [ | |
# + 'media-source', | |
# + 'media', | |
# ]; | |
# ... |
View backup-nas.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
found_not_mounted=0 | |
function check_not_empty() { | |
local path="$1" | |
if [ ! -d "$path" ]; then | |
found_not_mounted=1 | |
echo "ERROR: $path does not exist!" | |
elif [ ! "$(ls -A "$path")" ]; then |
View traceback-add-offsets.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
from collections import namedtuple | |
path_maps = os.path.expanduser("~/tmp/rpi-crash-maps") | |
path_stack = os.path.expanduser("~/tmp/rpi-crash-stack") | |
MapsLine = namedtuple("MapsLine", ["start", "end", "file"]) |
View page-watcher.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define __USE_POSIX199309 | |
#include <cassert> | |
#include <signal.h> | |
#include <mutex> | |
#include <functional> | |
#include <sys/ptrace.h> | |
#include <malloc.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <set> |
View webkit-remote-build.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
BUILD_HOST=homura.local | |
BUILD_ARGS=(--gtk --debug) | |
REMOTE_BUILD_DIR=WebKitBuild/Debug | |
LOCAL_BUILD_DIR=WebKitBuild/Debug | |
# Files big enough to deserve xdelta transfer | |
# Generate with the following command: |
View gen-edit-lists.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# Generate crazy MP4 edit lists to be added to media files for testing. | |
# | |
# 1. Modify the timescales below with the actual values from the MP4 file. | |
# | |
# 2. Run the following commands to patch the file with Bento: | |
# | |
# # Remove previously existing edit list (optional, only if there is some) | |
# mp4edit --remove moov/trak/edts original.mp4 patched1.mp4 |
View graceful-libvirtd-shutdown.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Wait for VMs to shutdown gracefully | |
After=libvirtd.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=true | |
ExecStop=/home/ntrrgc/dotfiles/bin/vm-shutdown | |
[Install] |
View patch-qtcreator-project.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Usage: python patch-qtcreator-project.py CMakeLists.txt.user -DPORT=GTK -DENABLE_MEDIA_SOURCE=ON ... | |
from argparse import ArgumentParser | |
from xml.etree import ElementTree | |
def clean_cmake_args(cmake_args): | |
""" | |
Not all arguments are relevant for QtCreator. | |
Returns a list with only the relevant ones. |
View find-borders.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This program scans images in order to find white borders having no | |
* substantial content inside. This can be used to automatically crop | |
* meaningless parts of images. | |
* | |
* This program is designed to work only with white backgrounds. | |
* | |
* A Qt based test utility is provided in the main() function. | |
* | |
* Copyright (c) 2016 Juan Luis Boya |
View spotify-heisenbug.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# For some reason, volume control lags in Spotify, but not when pavucontrol is | |
# executing. | |
# | |
# Other volume control apps, like gnome-control-center are not enough, it has | |
# to be pavucontrol. | |
# | |
# This is unfortunate, among other reasons, because pavucontrol uses quite a | |
# few CPU resources while opened. |
NewerOlder