Skip to content

Instantly share code, notes, and snippets.

View fredrike's full-sized avatar

Fredrik Erlandsson fredrike

View GitHub Profile
@mill1000
mill1000 / README.md
Last active April 22, 2024 07:24
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites

@nolageek
nolageek / pushover.py
Last active February 4, 2016 07:12
Pushover Notifications for x/84
import httplib, urllib
# Config
# You will need to sign up for a pushover.net account - and download
# their paid ios or android apps or their various 3rd party plugins.
# https://pushover.net/apps
appToken = "APPTOKEN HERE"
userKey = "USERKEY HERE"
@phec
phec / SemonLib20.cpp
Last active January 31, 2017 23:21
Port of Open Energy Monitor emonlib to Spark SemonLib.cpp
/*
Spark port of emonlib - Library for the open energy monitor
Original Created by Trystan Lea, April 27 2010
GNU GPL
Modified to suit Spark Core 10 Feb 2014 Peter Cowley
***********************
Changes made:
1) ADC range changed from 1023 to 4095
2) long EnergyMonitor::readVcc() deleted and calls replaced by 3300
@fredrike
fredrike / temp.sh
Last active December 22, 2015 15:28
#!/bin/bash
API_KEY=""
EMONCMS_API_KEY=""
FEED="https://api.xively.com/v2/feeds/ID"
OUT_URL="http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=IBLEKING8"
OUT="";
function temp_crc {
@jodell
jodell / shmsetup.sh
Created October 13, 2011 18:54
kernel shared memory calculator
#!/bin/bash
# http://archives.postgresql.org/pgsql-admin/2010-05/msg00285.php
# Output lines suitable for sysctl configuration based
# on total amount of RAM on the system. The output
# will allow up to 50% of physical memory to be allocated
# into shared memory.
# On Linux, you can use it as follows (as root):
#
# ./shmsetup >> /etc/sysctl.conf
@tkanmae
tkanmae / git-latexdiff.sh
Created August 5, 2011 21:54
A git-diftool utility for a TeX file using `latexdiff`
#!/usr/bin/env bash
# ================================================================================
# A git-diftool utility for a TeX file using `latexdiff`.
#
#
# Usage
# -----
# git latexdiff [<commit>]
# git latexdiff --cached [<commit>]
#