Skip to content

Instantly share code, notes, and snippets.

View timrichardson's full-sized avatar

Tim Richardson timrichardson

  • GrowthPath
  • Melbourne, Australia
View GitHub Profile
timrichardson /
Last active March 4, 2024 07:48
kubernetes health check for celery

from celery/celery#4079 (comment)

from celery import Celery, bootsteps
from celery.signals import after_setup_logger, setup_logging, worker_ready, worker_shutdown

HEARTBEAT_FILE = Path("/tmp/worker_heartbeat")
READINESS_FILE = Path("/tmp/worker_ready")
timrichardson /
Last active February 18, 2024 12:44
Amazon Music Linux External DAC high bit rates

Amazon Music streams different tracks at different rates, many above the default bit rate that pipewire ships with. This is how to fix it.

Firstly, I am running the Windows Amazon Music app via Crossover, a user-friendly version of wine. It works, it's stable. Ubuntu 22.04. Getting the app can annoying. Once you have the download file, keep it. The app automatically updates and amazingly this works in Linux too. here are some tips:

Reduce CPU use: I get much, much lower CPU by turning on the DXVK Advanced Option in the Crossover Bottle setting, which keeps the PC fans almost silent for me. The app has an option to use Hardware Accelarated Rendering. I doubt this works on Linux, and it makes no difference. The app doesn't do much rendering while playing back, perhaps this is more for browsing.

timrichardson / gist:f3be87134d2a06737b6b6678394be01e
Created April 12, 2021 05:56
Turn off bitmap fonts for Calibri in Linux
# put this in ~/.config/fontconfig (~ means in your home directory)
# this is relvevant if if you copied Calibri from a Windows fonts directory into your Linux install
# this way you get the latest version of Windows fonts, but the bitmapping for Calibri is not really designed to be used
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<match target="font">
<test qual="all" name="family" compare="contains">
timrichardson / gist:874c0d7ca2b15d2a034d96ccda219df1
Last active December 4, 2020 12:05
ansible playbook to set docker postgres configuration parameters based on host memory using community.general.postgresql_set and ansible_memtotal_mb
# ansible-playbook -i inventory -v yourplaybook.yml
# you need to add community.general to the local machine's ansible setup
# ansible needs to be 2.9.10 or later
- name: Snippets regarding postgres key parameter configuration
hosts: all
timrichardson / gist:1fd8ad33215377d849cb54266148beb1
Created June 2, 2020 04:29
Compile kernel from git, ubuntu
to return to the repo files,
git clean -fdx
--- TLP 1.2.2 --------------------------------------------
+++ Configured Settings: /etc/default/tlp
timrichardson /
Last active November 23, 2023 12:51
Modern way to edit gmail signatures with python3 and the gmail API
from string import Template
import time
import pytest
from google.oauth2 import service_account
from googleapiclient.discovery import build
from googleapiclient.errors import *
from google.auth.exceptions import *
import easygui
import pandas as pd
timrichardson / 0_reuse_code.js
Created July 22, 2016 23:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
timrichardson /
Last active September 8, 2021 18:06
Use Python, OAuth2 and Google APIs to mass-update gmail signatures of a Google Apps for Work domain. Using a google service account for the credential.
# python 2.7
# *********************************************************************************************************
# Please see
# for a modern way of doing this, using the current API and python 3
timrichardson /
Created April 30, 2015 11:24
Some examples of Unleashed API in Python 3.4
__author__ = 'tim'
import requests.auth
import binascii
import hashlib
import hmac
import prefs
import json
# tested only with python 3.4