Skip to content

Instantly share code, notes, and snippets.

View shamil's full-sized avatar
🎯
Focusing

Alex Simenduev shamil

🎯
Focusing
View GitHub Profile
@shamil
shamil / reroute.py
Last active July 7, 2021 08:24 — forked from FreeTymeKiyan/reroute.py
An example python script to reroute unassigned shards to NODE_NAME node thus recovering from the red cluster status
#!/usr/bin/env python3
#
# An example python script to reroute unassigned shards to NODE_NAME node,
# thus recovering from the red cluster status
#
# pip install requests before using requests
import requests
import json
@shamil
shamil / README.md
Last active January 23, 2023 18:30 — forked from notheotherben/README.md
Fix Postgres 9.x Sequences

PostgreSQL 9.x Sequence Fixing Script

This script is intended to automatically fix the sequence numbers for all tables in the current database.

This is accomplished through the use of the setval() command, which we provide with the next ID value we wish to make use of. We use the setval(sequence, number, is_called) overload and set is_called = false in conjunction with COALESCE(MAX + 1, 1) to ensure that, with an empty table, the next sequence value is 1 as expected.

Running

@shamil
shamil / pipewire.md
Created June 4, 2023 07:08 — forked from the-spyke/pipewire.md
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.