Skip to content

Instantly share code, notes, and snippets.

View the-spyke's full-sized avatar

Anton Alexandrenok the-spyke

View GitHub Profile
@the-spyke
the-spyke / pipewire.md
Last active April 18, 2024 20:17
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@the-spyke
the-spyke / scheduler.js
Last active December 13, 2017 08:38
Scheduler with concurrency limit and execution throttling
'use strict';
const https = require('https');
/**
* Create a `schedule` function to shcedule tasks within the specified limits
* @param {Number} [concurrency=2] - Concurrency limit
* @param {Number} [throughput=3] - Throughput limit (tasks per second, tps)
* @returns {Function} - The function to schedule tasks, returns a promise
*/