Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
@mss
mss / zoom-pulse-prop-media-role-phone-wrapper-installer.sh
Last active April 16, 2024 08:11
Make the Ubuntu Zoom client automatically switch Bluetooth headset profiles to HSP/HFP
#!/bin/bash
# This is a hack to make Bluetooth headests like the jabra Evolve 65 actually
# work as a headset with the Linux (Ubuntu/Debian) Zoom client without having
# to switch manually from A2DP to the HSP/HFP profile.
#
# This is done by injecting an environment variable which makes PulseAudio
# recognize the application as a telephony/voice application as described
# here:
# * https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#profiles
# * https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/ApplicationProperties/#pa_prop_media_role
// ==UserScript==
// @name YouTube Jump to Channel Videos
// @namespace http://tampermonkey.net/
// @version 0.6
// @description Redirect links in the subscription list to videos tab instead of the home tab (only works for open in new tab/window)
// @author Nathaniel Wu
// @include *www.youtube.com/*
// @license Apache-2.0
// @supportURL https://gist.github.com/Nathaniel-Wu/b9cbdc29b2b33c7d49993ef70d7993d7
// @grant none
@anakuron
anakuron / free-watchdog.sh
Last active October 9, 2023 16:47
pushover memory alert
#!/bin/bash
free=$(free -mt | grep Mem | awk '{print $4}')
if [[ "$free" -le 100 ]]; then
ntfy -b pushover -o user_key YOURKEY send 'memory is less than 100MB'
fi
exit 0
@catrincm
catrincm / weeklyAgenda.gs
Last active February 26, 2024 14:38
Email yourself weekly calendar agenda with google apps script
EMAILRECIPIANT = "myemail@gmail.com";
function agendaEmail() {
let dateOptions = { weekday: 'long', month: 'long', day: 'numeric'};
let timeOptions = { hour12:true, hour:'numeric', minute:'numeric'};
var StartDate = new Date();
@sanjay-bhuva
sanjay-bhuva / ubuntu-cleanup-utility.sh
Last active August 20, 2020 22:06
Ubuntu cleanup utility to clean common junk and free up space
#!/bin/bash
# Script to perform some useful linux cleanup operations
# 1. Download the file
# 2. Make it executable using chmod +x ubuntu-cleanup-utility.sh
# 3. Run command below command
# sudo ./ubuntu-cleanup-utility.sh
REMOVE_LOG_OLDER_THEN_DAYS=1
SNAP_DIR=/var/lib/snapd/snaps
@henri
henri / pushover.sh
Last active November 15, 2020 23:44
PushOver
#! /bin/bash
#
# RELEASED UNDER MIT LICENCE : https://mit-license.org
# Copyright Allrights Reserved 2020, Henri Shustak
# This Script Works With the PushOver <http://pushover.net> service and is capable of sending notifcations to your phone.
#
# Usage: ./pushover.bash message title url url_title priority device'
#
# Example: ./pushover.sh "this is a test" "test title" "http://mylink.com" "my url title" 0 "iPhone"'
# Note: All parameters except message are optional'
@SydLambert
SydLambert / somafm-mpd-playlists.sh
Created May 2, 2020 18:59
Add all channels on Soma FM to MPD as individual playlists. Requires mpc and GNU grep. Will empty playlist before starting.
#!/usr/bin/env sh
mpc clear
curl -s https://somafm.com/channels.xml | grep -Po '((?<=<title><!\[CDATA\[).+?(?=\])|(?<=id=").+?(?="))' | sed 'N;s/\n/ /' | while read -r p; do
curl -s "https://somafm.com/$(echo "$p" | grep -Po '^.+?(?= )')130.pls" | grep -Po '(?<=File\d=).+$' | head -n 1 | xargs mpc add;
mpc save "Soma FM - $(echo "$p" | grep -Po '(?<= ).+$')"
mpc clear
done
@jesvs
jesvs / mpcsimilar.sh
Last active June 1, 2023 20:44
Shell script that uses last.fm API to add similar artists to MPD.
#!/bin/bash
# depends on jq to parse json
# https://stedolan.github.io/jq/
#
# This script will query the last.fm API for
# similar artists based on the currently playing track.
# It will crop the current playlist, and shuffle the API results.
#
# You can configure 3 parameters:
@cmer
cmer / proxmox-fresh.sh
Last active January 4, 2024 10:40
Proxmox fresh install starter pack
#!/bin/bash
apt update -y
apt install -y lsb-release sudo vim screen curl htop
RELEASE=`lsb_release -sc`
# Install no-nag
cd /tmp
curl -s https://api.github.com/repos/Jamesits/pve-fake-subscription/releases/latest \
| grep "browser_download_url.*deb" \
@PieGuy314
PieGuy314 / bt-addr.sh
Last active December 2, 2023 12:10
Update/Create ALSA config file with updated BD_ADDR
#!/bin/sh
#
# Update alsa config file with new BD_ADDR
# Backup original
# Create a new config file if one doesn't exist
usage() {
echo "Usage: $0 xx:xx:xx:xx:xx:xx"
}