Skip to content

Instantly share code, notes, and snippets.

@zw
zw / a2dp_sink_ubuntu_linux.md
Created August 14, 2012 13:01 — forked from joergschiller/a2dp_sink_ubuntu_linux.md
A2DP Sink on Ubuntu Linux with bluez (streaming bluetooth stereo audio from smartphone to pc)

Howto Enable and Use A2DP Sink on Ubuntu Linux with Bluez

  1. Add Enable=Source to /etc/bluetooth/audio.conf right after [General].

  2. Find address in form XX:XX:XX:XX:XX:XX of phone with hcitool scan.

  3. Pair and trust smartphone with sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX and sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes.

  4. Create loopback in pulseaudio connection bluetooth a2dp source with alsa sink:

@zw
zw / explicitly-X11-only.patch
Created April 13, 2011 07:27
Patch against DjView 4.7 to disable plug-in builds without an X11-based Qt, and make clear why
--- djview-4.7-pristine/configure.ac 2011-03-06 17:15:58.000000000 +0000
+++ djview-4.7-state-noCocoa/configure.ac 2011-04-13 08:21:08.000000000 +0100
@@ -59,12 +59,10 @@
case "$host" in
*-darwin* | *-macos10*)
if test -d /opt/local ; then
- CFLAGS="$CFLAGS -I/opt/local/include"
- CXXFLAGS="$CXXFLAGS -I/opt/local/include"
+ CPPFLAGS="$CPPFLAGS -I/opt/local/include"
LDFLAGS="$LDFLAGS -L/opt/local/lib"
@zw
zw / minimal-page-fragment-support-broken-fraghack-attempt.patch
Created April 4, 2011 16:06
Patch to r102 of http://code.google.com/p/firefox-mac-pdf to support http://example.com/my.pdf#page=123 (with a failed attempt to respond to subsequent fragment edits)
Index: prebuilt/extension/components/PDFService.js
===================================================================
--- prebuilt/extension/components/PDFService.js (revision 102)
+++ prebuilt/extension/components/PDFService.js (working copy)
@@ -145,6 +145,9 @@
chromeWindow.goDoCommand = createGoDoCommand(chromeWindow, chromeWindow.goDoCommand);
+ // "hash" == RFC 3986 section 3.5 fragment.
+ window.onhashchange = createScrollToNewFragment(chromeWindow, window.onhashchange);
@zw
zw / minimal-page-fragment-support.patch
Created April 4, 2011 15:46
Patch to r102 of http://code.google.com/p/firefox-mac-pdf to support http://example.com/my.pdf#page=123 (jumps to page on load but doesn't respond to subsequent fragment edits)
Index: src/PluginInstance.mm
===================================================================
--- src/PluginInstance.mm (revision 102)
+++ src/PluginInstance.mm (working copy)
@@ -185,8 +185,57 @@
PDFDocument* document = [[[PDFDocument alloc] initWithData:pdfData] autorelease];
[document setDelegate:self];
[pdfView setDocument:document];
+ [self scrollToNewFragment:_url];
}
@zw
zw / fix-MAF-fragment-drops.patch
Created April 2, 2011 10:34
Patch to MAF 1.0.0-sm+fx to stop it dropping #fragments upon single-page archive access
diff -Naur 1.0.0-sm+fx/chrome/content/caching/archiveCacheObject.js dont-drop-fragments/chrome/content/caching/archiveCacheObject.js
--- 1.0.0-sm+fx/chrome/content/caching/archiveCacheObject.js 2010-12-11 19:50:28.000000000 +0000
+++ dont-drop-fragments/chrome/content/caching/archiveCacheObject.js 2011-04-02 11:13:12.000000000 +0100
@@ -40,6 +40,19 @@
*/
var ArchiveCache = {
+ defrag: function(aSpec) {
+ var URIObj = Cc["@mozilla.org/network/io-service;1"].
+ getService(Ci.nsIIOService).newURI(aSpec, null, null);