Skip to content

Instantly share code, notes, and snippets.

@allebb
allebb / README.md
Created March 15, 2018 11:48 — forked from mill1000/README.md
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

@allebb
allebb / after.sh
Created September 13, 2017 20:03 — forked from justincampbell/after.sh
Jenkins + GitHub Commit Status API
if [[ $BUILD_STATUS == "success" ]]
then
export STATUS="success"
else
export STATUS="failure"
fi
curl "https://api.github.com/repos/justincampbell/my_repo/statuses/$GIT_COMMIT?access_token=abc123" \
-H "Content-Type: application/json" \
-X POST \
@allebb
allebb / create_php_site.sh
Created September 12, 2017 15:54 — forked from jun9/create_php_site.sh
Nginx and PHP-FPM, bash script for creating new vhost’s under separate fpm pools
#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 17/05/2012
# Modify the following to match your system
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
@allebb
allebb / git-backup-to-AWS-S3.sh
Created August 29, 2017 18:44 — forked from philippb/git-backup-to-AWS-S3.sh
Complete git repository backup script to AWS S3
#!/bin/bash
# Script to backup git repo to S3
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc
bucket=$GITHUB_BACKUP_BUCKET
dir=$GITHUB_BACKUP_DIR
password=$GITHUB_BACKUP_PASSWORD
account=$GITHUB_ACCOUNT
@allebb
allebb / makefile
Created August 29, 2017 09:25
Laravel makefile for projects with Git and MySQL
# == Git repo ==
repo=my_awesome_repo
# === Artisan ====
p=8000
# ===== DB =======
db_username=user
db_password=password
db_name=laravel
db_file=my_db.sql
# === Server connection =====
@allebb
allebb / install-oh-my-zsh-on-ubuntu
Created February 20, 2017 21:33 — forked from richardtape/install-oh-my-zsh-on-ubuntu
Install Oh My ZSH on Ubuntu 14.04
# Where is the location of your current shall. Useful if we need to revert
echo $0
# Install ZSH
sudo apt-get install zsh
# Instal GIT
sudo apt-get install git-core
# Install OhMyZSH
@allebb
allebb / compass-cardinal
Created August 16, 2016 15:21 — forked from adrianstevens/compass-cardinal
Compass heading to cardinal direction in c#
public static string DegreesToCardinal(double degrees)
{
string[] caridnals = { "N", "NE", "E", "SE", "S", "SW", "W", "NW", "N" };
return caridnals[ (int)Math.Round(((double)degrees % 360) / 45) ];
}
public static string DegreesToCardinalDetailed(double degrees)
{
string[] caridnals = { "N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW", "N" };
return caridnals[ (int)Math.Round(((double)degrees*10 % 3600) / 225) ];
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated with https://github.com/barryvdh/laravel-ide-helper
* Updated for Laravel 4.1.8 (2013-12-13)
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
*/
exit('Only to be used as an helper for your IDE');