Skip to content

Instantly share code, notes, and snippets.

bz31 bz31

Block or report user

Report or block bz31

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bz31
bz31 / README.md
Created Nov 15, 2019 — forked from mill1000/README.md
Headless A2DP Audio Streaming on Raspbian Stretch
View README.md

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

@bz31
bz31 / latency.txt
Created Dec 18, 2018 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@bz31
bz31 / gist:073adedc362b361d0317d7ef64b3c305
Last active Nov 7, 2019 — forked from naodesu/gist:10620506
How to mount ubifs image in Linux Debian Stretch.
View gist:073adedc362b361d0317d7ef64b3c305
# Install mtd-utils
# $UBIFS is a ubifs image file
# make sure $UBIFS is a ubifs image file
blkid $(UBIFS)
$(UBIFS): ... TYPE="ubifs"
# size of created mtd is 256.0 MiB
/usr/sbin/modprobe nandsim first_id_byte=0x2c second_id_byte=0xda third_id_byte=0x90 fourth_id_byte=0x95
/usr/sbin/flash_erase /dev/mtd0 0 0
You can’t perform that action at this time.