Skip to content

Instantly share code, notes, and snippets.

@jwbee
jwbee / jq.md
Last active April 5, 2025 13:06
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

@Raimo33
Raimo33 / speed_optimizations.md
Last active April 4, 2025 17:17
C Speed Optimizations

C Speed Optimization Checklist

This is a list of general-purpose optimizations for C programs, from the most impactful to the tiniest low-level micro-optimizations to squeeze out every last bit of performance. It is meant to be read top-down as a checklist, with each item being a potential optimization to consider. Everything is in order of speed gain.

Algorithm && Data Structures

Choose the best algorithm and data structure for the problem at hand by evaluating:

  1. time complexity
@estelsmith
estelsmith / readme.md
Last active October 31, 2024 19:31
Gemini Lake Hardware-accelerated Transcoding

Gemini Lake Hardware-accelerated Transcoding

This is for a used Wyse 5070 I recently purchased, having the J5005 CPU and a huge 8 GB RAM all running on AlmaLinux 9.1. Why AlmaLinux? Because I'm partial to RHEL-based systems with its focus on stability, that's all. Unfortunately the downside is that oftentimes new software isn't readily available.

I want to unlock the ability to perform hardware-accelerated transcoding in ffmpeg so I can use it in Tdarr as a decent remote transcoding node.

Intel ARK - Pentium Silver J5005 shows that the CPU has Quick Sync Video support, and as such supports some form of hardware video acceleration.

The CPU is Gemini Lake and uses Intel UHD Graphics 605, which is Gen 9.5 according to the ffmpeg wiki. The machine should be able

@Hritik14
Hritik14 / multi-net.sh
Last active April 23, 2023 17:19
Multipath routing to increase bandwith
#!/bin/bash
# (C) Hritik Vijay
# License: GPLv2
# Suppliment to https://m47r1x.github.io/posts/multi-net/
tmp=$(mktemp multi-net-ip-XXXX --tmpdir)
TIMEOUT=5
Table=200
_ping(){
@Venemo
Venemo / mesa-howto.md
Last active April 4, 2025 17:36
How to build and use mesa from source

Building and using mesa for development and testing

This explains how to build mesa from source, and how to use the custom built mesa to run some apps and games, without needing to replace the mesa libraries that your operating system runs on.

Let's assume that you are using an x86_64 system.

Building mesa

Overview

@calvinbui
calvinbui / rpl.py
Last active October 20, 2022 14:04
FreeNAS Replication Details
"""
FreeNAS Replication status
"""
import os
import time
import sys
from datetime import datetime, timedelta
def bytes_to_gb(filesize):
return filesize / 1024 / 1024 / 1024
@0Camus0
0Camus0 / LinuxWayland.cpp
Created February 11, 2018 04:53
Wayland
#include <video/GLDriver.h>
#include <core/LinuxFramework.h>
#include <stdio.h>
#include <sys/time.h>
extern int g_AvoidInput;
extern std::vector<std::string> g_args;
namespace t800 {
#ifdef USING_WAYLAND_NATIVE
struct wl_compositor *wlnd_compositor = 0;
@kowalcj0
kowalcj0 / install_MKVToolNix_and_handbrake.sh
Created July 2, 2017 16:08
Run HandBrake & MKVToolNix on a headless FreeBSD jail (FreeNas)
# 1 - Create a jail called `convert` using `pluginjail-10.3` template
# 2 - list all jails
jls
JID IP Address Hostname Path
1 - convert /mnt/volume/jails/convert
# 3 - connect to our jail
jexec 1 sh
@braian87b
braian87b / dumb-ap-wired-link.sh
Last active March 1, 2025 19:22
How to setup a Dumb AP, Wired backbone for OpenWRT / LEDE
@mRB0
mRB0 / ntfs-find-files-affected-by-ddrescue-bad-chunks.py
Created March 19, 2016 18:43
After you use gnu ddrescue on a drive with an NTFS filesystem, this script uses your ddrescue logfile & ntfs-3g to list files affected by unrecoverable bad chunks
#!/usr/bin/env python
import sys
import os
import subprocess
import re
from StringIO import StringIO
# usage:
#