Skip to content

Instantly share code, notes, and snippets.

View tstromberg's full-sized avatar
🚀
Making Chainguard awesome.

Thomas Strömberg tstromberg

🚀
Making Chainguard awesome.
View GitHub Profile
@tstromberg
tstromberg / pull_qardio_csv.sh
Created September 7, 2016 23:40
Export Qardio heartbeat measurements from an Android phone to a local CSV file.
#!/bin/bash
#
# Export Qardio heartbeat measurements to a local CSV file.
set -eux -o pipefail
adb shell "echo cp /data/data/com.getqardio.android/databases/qardio.db /mnt/sdcard/ \| su"
adb shell "echo chmod 777 /mnt/sdcard/qardio.db \| su"
adb pull /mnt/sdcard/qardio.db
echo -e '.mode csv\nSELECT * FROM measurements;' \
| sqlite3 qardio.db | tee qardio.csv