Skip to content

Instantly share code, notes, and snippets.

@saaj
saaj / update_autoeq.ipynb
Created March 20, 2024 21:31
Update Pulseeffects output preset JSON from AutoEq txt
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/python3
"""Elasticsearch ``application/x-ndjson`` file loader."""
import argparse
import fileinput
import itertools
import json
import logging
import sys
from urllib.error import HTTPError
@saaj
saaj / applet_hack.diff
Last active April 11, 2023 15:06
Hack for multicore-sys-monitor@ccadeptic23 to show disk usage on /sys/block/nvme0n1
--- d93743f/3.4/DataProviders.js
+++ 3.4/DataProviders.js
@@ -1,5 +1,6 @@
const Gio = imports.gi.Gio;
const GIRepository = imports.gi.GIRepository;
+const GLib = imports.gi.GLib;
let _, tryFn, GTop;
if (typeof require !== 'undefined') {
@@ -356,16 +357,40 @@
@saaj
saaj / make-rdm-app-image.sh
Last active October 26, 2022 19:13
Convert Redis Desktop Manger's Snap into an AppImage
#/bin/bash -e
# This coverts Redis Desktop Manager's Snap into an AppImage.
# Inspired by https://github.com/AppImage/AppImageKit/issues/166
# Tested on Linux Mint 18 / Ubuntu Xenial
if ! [ -x "$(command -v unsquashfs)" ]; then
echo 'Error: squashfs-tools is not installed.' >&2
exit 1
fi
@saaj
saaj / build-plotly-falcon-appimage.sh
Last active July 16, 2021 12:50
Build Plotly Falcon AppImage with fresh SQLite3
#!/bin/bash -e
VERSION=4.1.0
mkdir dist
chmod 777 dist
cat << EOF > docker-build.sh
#!/bin/bash -e
@saaj
saaj / HISTORY.rst
Last active May 10, 2020 10:45
Better die with SL4A/QPython3 and Python on Android
@saaj
saaj / HISTORY.rst
Last active May 10, 2020 10:43
Example of using thread and process pools to make parallel queries to MySQL
@saaj
saaj / Dockerfile
Last active May 10, 2020 10:41
Python3 MySQL adapter benchmark
FROM ubuntu:trusty
ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8
RUN apt-get update -q
RUN apt-get install --no-install-recommends -qy \
mysql-server libmysqlclient-dev python3-pip python3-dev build-essential
RUN apt-get install --no-install-recommends -qy wget
RUN pip3 install mysqlclient pymysql pytest-benchmark
@saaj
saaj / build_jupyterlab_venv.sh
Created May 10, 2020 10:40
Build JupyterLab Python virtual environment with extensions without installing Nodejs locally
#!/bin/bash -e
VENV=/home/user/some/path/to/venv/jupyterlab
docker build -t jupyterlab-venv --build-arg VENV=$VENV - <<EOF
FROM ubuntu:bionic
ARG VENV
RUN apt-get update && apt-get install -y --no-install-recommends \