Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
@brett-fitz
brett-fitz / google-drive-backup.py
Created January 26, 2024 15:51
Google Drive download all my items and those that are shared with me
import os
import re
import io
from googleapiclient.discovery import build
from googleapiclient.http import MediaIoBaseDownload
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
from google.oauth2.credentials import Credentials
@sayoder
sayoder / ak70.sh
Last active January 28, 2024 03:35
rsync to Astell&Kern AK70 over mtp
#!/bin/bash
# Requirements: go-mtpfs, rsync, fuse2
MUSICDIR="/home/<USER>/Music/"
DEVICEMUSICDIR="/mnt/ak70/Internal storage/Music/"
MOUNTPOINT="/mnt/ak70/"
print_usage() {
echo "Usage: $0 mount|umount|drysync|fullsync|hardsync|sync"
#!/usr/bin/python3
import csv
import beets.library
from termcolor import colored
import beets.ui
LIBRARYDB = '/home/MYUSER/.config/beets/library.db'
EXPORTIFY_CSV = './spotify.csv'
@tunalad
tunalad / notify-battery.sh
Last active October 9, 2023 16:33
Simple battery notification system using `dunst` for local notifications, and ntfy for mobile push notification. Create a cronjob that will run this script.
#!/usr/bin/bash
DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
export XDG_RUNTIME_DIR="/run/user/1000"
HOSTNAME=$(uname -n)
NTFY_TOPIC="your notify.sh topic here"
acpi -b | awk -F'[,%]' '{print $2, $4, $5}' | {
read -r capacity timeleft status
#!/usr/bin/bash
# ------------------------------------------------------------------------------
# [INFO]
# If you are not registered as sudoers, you will be asked for your password.
# ------------------------------------------------------------------------------
echo "🚀 A setup scripts for Ubuntu Desktop 22.04 LTS."
# ------------------------------------------------------------------------------
# This is a anonymized version of the script I use to renew all my SSL certs
# across my servers. This will not work out of the box for anyone as your network will be
# different. But may be useful starting place for others.
#
# I use a cronjob that runs this every week. It only replaces certificates when a certificate has been renewed.
# Renews/creates cert from letsencrypt & places it where it needs to be.
# Currently, that is:
# * Nginx (local for plex)
# * Plex Media Server
@sydragos
sydragos / bt_moode.sh
Last active March 16, 2024 04:42
Adding Additional Bluetooth Codec Support to Moode
#!/usr/bin/env bash
# Inspired by https://steveblock.com/moode-bluetooth-codecs/
# and his post at https://moodeaudio.org/forum/showthread.php?tid=3683
# with an extra sprinkle of https://github.com/anonymix007/libldacdec
# and built with latest dependencies on moOde 8.3.2 on rpi zero W
#
# Currently having issues with LDAC itself
LDAC_INCLUDE_DIR=/usr/include/ldac
#!/usr/bin/env bash
#
# Script is a mini version of https://github.com/jules-ch/Ubuntu20-Setup-XPS13/blob/master/setup.sh
set -ex
# Get the Ubuntu version installed
DISTRO_VER=$(lsb_release -r -s)
LOGIN_USER=$(logname)
@mschwld
mschwld / gist:b47bfc37f73329a7a10f51377998e84f
Last active January 26, 2025 05:17
Simple mpd bookmarks
#!/usr/bin/env bash
function DEPENDENCY_CHECKS {
for dep in $@; do
if ! hash "$dep" 2>/dev/null 1>&2; then echo "$dep not found in \$PATH. Abort." && exit 1; fi
done
}
DEPENDENCY_CHECKS mpc
MPC_OPTS="--port 6601"
@Bubblemelon
Bubblemelon / populateCalSunRiseNSet.gs
Last active June 14, 2022 03:35
Populates a Google calendar titled "Rise and Fall", using the a free sunrise and sunset API from a specified date range for San Francisco.
/**
* EXAMPLE: https://developers.google.com/calendar/api/quickstart/apps-script
* @see https://developers.google.com/calendar/api/v3/reference/events/list
*
*
* Sun rise and set API: https://sunrise-sunset.org/api
*
*/
function populateCalSunRiseNSet() {