Skip to content

Instantly share code, notes, and snippets.

@ConnorWGarvey
ConnorWGarvey / headphones
Last active February 2, 2023 22:28
Every new version of BlueMan or PulseAudio on Ubuntu breaks my Bluetooth headphones in new ways. Lately, I have to connect, set the profile to "off", set the profile to "headset", disconnect, reconnect, set the profile to "high fidelity audio". Here's a script that does all of that. Put it on your path and run "headphones".
#!/usr/bin/env ruby
# Requires these libraries
#
# $ gem install colorize, open4
# sudo service bluetooth restart
# or
# sudo /etc/init.d/bluetooth restart
@netj
netj / memusg
Last active January 29, 2024 15:04
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #