Skip to content

Instantly share code, notes, and snippets.

View shamil's full-sized avatar

Alex Simenduev shamil

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

shamil / alertmanager.yml
Last active January 25, 2024 01:24
Prometheus - better slack messages
- name: default
- api_url:
channel: alerts
send_resolved: true
title: '' # important, put empty string here
text: '{{ template "slack.shamil.text" . }}'
shamil /
Last active January 23, 2023 18:30 — forked from notheotherben/
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.


shamil /
Last active December 28, 2017 13:53
Displaying a remote SSL certificate details using CLI tools


nmap -p 443 --script ssl-cert

The -p 443 specifies to scan port 443 only. All ports will be scanned if it is omitted, and the certificate details for any SSL service that is found will be displayed. The --script ssl-cert tells the Nmap scripting engine to run only the ssl-cert script. From the doc, this script "(r)etrieves a server's SSL certificate. The amount of information printed about the certificate depends on the verbosity level."

Sample output:

Starting Nmap 7.40 ( ) at 2017-11-01 13:35 PDT

Nmap scan report for (

shamil /
Last active March 24, 2023 20:02
Rundeck executions cleanup
#!/bin/bash -e
# see related issue:
# export required vars
export RD_URL=http://localhost:4440 RD_USER=admin RD_PASSWORD=admin RD_HTTP_TIMEOUT=300
# make sure rd & jq commands are in the PATH
which -- rd jq >/dev/null
del_executions() {
shamil /
Last active July 7, 2021 08:24 — forked from FreeTymeKiyan/
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 /
Created February 24, 2017 21:37
TFTP server on Fedora


TFTP server on Fedora

Here are some quick notes on setting up a TFTP server on Fedora 23. This is used, for example, to send Linux kernel images and other binaries to a bootloader on an embedded system.

First, install the packages:

sudo dnf install -y tftp tftp-server

shamil /
Created December 26, 2016 18:35 — forked from ruebenramirez/
setup franz on ubuntu
sudo rm -fr /opt/franz
sudo rm -fr /usr/share/applications/franz.desktop
# create installation dir
sudo mkdir -p /opt/franz
#install franz
-- PostgreSQL, create read-only user
-- Option 1
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
shamil / gcr-tags.go
Last active August 22, 2016 20:29 — forked from rjeczalik/gcr-tags.go
Reads a tag list for Google Container Registry for the given image.
package main
import (