Skip to content

Instantly share code, notes, and snippets.

View bonelifer's full-sized avatar

William Jacoby bonelifer

View GitHub Profile
@bonelifer
bonelifer / bt-addr.sh
Created December 2, 2023 12:10 — forked from PieGuy314/bt-addr.sh
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"
}
@bonelifer
bonelifer / gist:5b9e7e38ce6f732b953129d5959aad2c
Created December 2, 2023 12:06 — forked from emmaly/gist:8267078
Bash script to automatically switch PulseAudio sink to Bluetooth headset on connect with A2DP profile and 50% volume.
#!/bin/bash
sink_name="bluez_sink.00_42_1B_AD_FA_CE"
if [ -z "$1" ]; then
dbus-monitor --system "path=/org/bluez/777/hci0/dev_00_42_1B_AD_FA_CE, interface=org.bluez.AudioSink, member=Connected" | while read line; do
echo $line
$0 1
done
else
@bonelifer
bonelifer / pipewire-bluetooth-headphone-manager
Created December 2, 2023 12:01 — forked from abdullahkhalids/pipewire-bluetooth-headphone-manager
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
#!/bin/bash
if [ "$1" == "-h" ] || [ "$1" == "--help" ]
then
me=`basename "$0"`
echo "Find information about TCP/IP ports."
echo -e "Usage:\n\t./${me} [port|service]"
echo -e "Example:\n\t./${me} snmp\n\t./${me} 3389"
exit 1
fi
#!/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)
#IMPORTANT
sudo apt update &&
sudo apt install -y software-properties-common curl wget pavucontrol #pavucontrol is for audio configs
#Themes and Tweak (Ubuntu)
sudo add-apt-repository ppa:numix/ppa
sudo apt update
sudo apt install -y numix-gtk-theme numix-icon-theme-circle
sudo apt install -y unity-tweak-tool gnome-tweak-tool
#!/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."
# ------------------------------------------------------------------------------
@bonelifer
bonelifer / _README.md
Created November 22, 2023 09:41 — forked from oleq/_README.md
A2DP audio streaming using Raspberry PI (Raspbian Jessie)

What is this all about?

This tutorial will turn your Raspberry PI into a simple Bluetooth audio receiver, which plays music through connected speakers. It's like a regular car audio system, but it can be used anywhere and it's a good value.

   Audio source (i.e. smartphone) 
                |
                v
 (((  Wireless Bluetooth Channel  )))
 |

I wanted to do an automatic sync of a directory in my hard drive with 1 directory in my mp3 player (MSU Enabled) To launch an action on detecting it

I used the udev system by creating a rule under /etc/udev/rules.d/10-local.rules

SUBSYSTEMS=="scsi", ATTRS{model}=="MK3006GAL       ", SYMLINK+="DAP", MODE="0666"
SUBSYSTEMS=="scsi", ATTRS{model}=="MK3006GAL       ", ACTION=="add", RUN+="/usr/local/bin/music-sync %k"

The first line creates a symbolic link called DAP under /dev/ \ The second line runs a script I wrote to sync (and mount if required) the device

@bonelifer
bonelifer / Xubuntu-Install.sh
Created November 22, 2023 09:32 — forked from ascenderx/Xubuntu-Install.sh
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.