Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
@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() {
@abdullahkhalids
abdullahkhalids / pipewire-bluetooth-headphone-manager
Created March 9, 2022 16:09
A bash script that helps reliably connect to bluetooth headphones. Just bind the three possible inputs to different keyboard shortcuts.
#!/bin/bash
#sudo systemctl start bluetooth.service
connect() {
bluetoothstatus=`bluetooth | cut -c 13-`
if [ "$bluetoothstatus" == "off" ]; then
bluetooth on
@lbmaian
lbmaian / youtube-hide-livechat.user.js
Last active April 17, 2024 11:41
YouTube - Hide Live Chat By Default
// ==UserScript==
// @name YouTube - Hide Live Chat By Default
// @namespace https://gist.github.com/lbmaian/94824cef728917a53d3c6e6ea885469c
// @downloadURL https://gist.github.com/lbmaian/94824cef728917a53d3c6e6ea885469c/raw/youtube-hide-livechat.user.js
// @updateURL https://gist.github.com/lbmaian/94824cef728917a53d3c6e6ea885469c/raw/youtube-hide-livechat.user.js
// @version 0.14
// @description Hide live chat by default on live streams
// @author lbmaian
// @match https://www.youtube.com/*
// @exclude https://www.youtube.com/embed/*
@FrakGart
FrakGart / mythcutvideo.sh
Last active October 17, 2022 00:19
A script for cutting H264 encoded recordings in Mythtv based on its cutlist
#!/bin/bash
# Based on script by
# Ian Thiele
# icthiele@gmail.com
# Which can be found here https://www.mythtv.org/wiki/H264_commercial_remover_and_remuxer
#
# Uses mythcommflag and mkvmerge to cut commercials out of h.264 encoded ts files
# Puts cut video into the workdir
@ascenderx
ascenderx / Xubuntu-Install.sh
Created September 2, 2021 05:29
Xubuntu installation history & notes
# Flash the image onto a USB stick.
# - Replace `/path/to/xubuntu.iso` with the appropriate ISO image.
# - Replace `sdX` with the appropriate device node.
sudo dd if=/path/to/xubuntu.iso of=/dev/sdX conv=fdatasync status=progress bs=1M
# Boot into the USB stick and run the installer.
# You might need to boot into the PC's UEFI settings to do so.
# Make sure the install medium is botted in UEFI mode!
# On the new installation, run the following installers.
@tomrod
tomrod / somaFm_function.sh
Last active November 21, 2023 01:25
SomaFM from the command line
function listen_soma() {
local playlist=$1
local -a stations=('defcon' 'lush' 'fluid' 'poptron' 'subursbofgoa' 'beatblender' 'bootliquor' 'illstreet' 'thistle' 'metal' 'covers' 'cliqhop' 'dubstep' '7soul' 'seventies' 'u80s' 'reggae' 'secretagent' 'thetrip' 'sonicuniverse' 'bagel' 'indiepop' 'digitalis' 'folkfwd' 'n5md' 'groovesalad' 'synphaera' 'vaporwaves' 'deepspaceone' 'spacestation' 'dronezone' 'brfm' 'sf1033' 'scanner' 'sfinsf' 'missioncontrol' 'live' 'specials' 'gsclassic')
if [[ " ${stations[*]} " =~ " ${playlist} " ]]; then
mplayer -playlist "http://soma.fm/"${playlist}".pls"
else
echo "station not in stationlist: ${stations[*]}."
fi
}
@Pigpog
Pigpog / skipdetect.sh
Last active October 12, 2023 09:25
FOR MPD - Skips songs you don't like. Uses a per-song score, calculated based on whether you skip the song or let it play. The only dependency is MPC, as this script is almost entirely BASH. When the next song's score is negative, the script "rolls the dice" and if the score is <= the dice roll, it will skip it when it comes on.
#!/bin/bash
# Automatically skips songs you dont like
# Skipping a song decreases its score
# Playing it for >15 seconds increases it
# Songs are skipped randomly based on their score
# Location of database file
DBFILE=~/scripts/database
@TehPeGaSuS
TehPeGaSuS / thelounge_purge.sh
Last active April 28, 2024 20:53
Some useful stuff to use with The Lounge
#!/usr/bin/env bash
#------------------------------------------------------#
# This script was tested on Ubuntu 20.04 and newer #
# #
# This script cleans up the SQLite database, plaintext #
# files and uploaded files #
#------------------------------------------------------#
#-------------------------------------------------------------------------------------#
@routetonull
routetonull / myip.sh
Created December 5, 2020 18:59
Get public IP, send Telegram notification if it changes from previous result
#!/bin/bash
# get public IP, send Telegram notification if it changes from previous result
# run with cron
# */5 * * * * ~/myip.sh >/dev/null 2>&1
# requires https://github.com/dschep/ntfy and a Telegram bot
file1="/tmp/ip1.txt"
file2="/tmp/ip2.txt"
touch $file2