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 / 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 \
@saaj
saaj / HISTORY.rst
Created April 26, 2020 20:10
SQLite3 multi-value bulk insert PK generation consequence test
@saaj
saaj / .bash_aliases
Last active May 10, 2020 09:13
Bash alias for process group RSS percentage via termsql
alias topmem='smemstat -sm | termsql -01 -r 6 -T 3 "SELECT SUM(PSS) as PSS, SUM(RSS) as RSS, Command \
FROM tbl GROUP BY Command ORDER BY SUM(PSS) DESC LIMIT 5" | column -t -s "|"'
alias topmemps='ps -x -o rss,%mem,cmd | termsql -m tabs -01 "SELECT SUM(rss) / 1024 as RSS, SUM([%mem]) AS PCT, cmd \
FROM tbl GROUP BY cmd ORDER BY SUM(rss) DESC LIMIT 5"'
@saaj
saaj / HISTORY.rst
Created April 26, 2020 20:05
Local DynamoDB and simplistic administrative UI