Skip to content

Instantly share code, notes, and snippets.

@lduboeuf
lduboeuf / log debug ofono Ubuntu Touch
Last active December 9, 2022 16:33
ofono debug logs Ubuntu Touch
[XENIAL]
debug ofono:
sudo mount -o remount,rw /
sudo service ofono stop
Add `-d *` to the exec line in /etc/init/ofono.override => `exec ofonod -d *`
sudo service ofono start
It logs to `syslog`
If not possible to edit `ofono.override`,
@lduboeuf
lduboeuf / UT modem logs
Last active December 6, 2022 11:22
UT modem logs
#set ril log to on
sudo env LD_LIBRARY_PATH=/system/lib64:/vendor/lib64 lxc-attach -n android -e -- /system/bin/setprop persist.radio.adb_log_on 1
#in P3a (20.04) persist.vendor.radio.adb_log_on 1
reboot
sudo env LD_LIBRARY_PATH=/vendor/lib64:/system/lib64 /system/bin/logcat -b radio
@lduboeuf
lduboeuf / account-migration.py
Created November 25, 2022 21:27
account migrqtion history db
#!/usr/bin/python3
import os
import re
import sqlite3
import shutil
def migrate(con, fromAccount, toAccount):
print(f'Start to migrate {fromAccount} to {toAccount}')
@lduboeuf
lduboeuf / backupct.sh
Last active November 8, 2022 21:42
test bashwget
OUT=/home/phablet/Documents/contactsfromnewbackend.csv
sqlite3 -header -csv /home/phablet/.local/share/system/privileged/Contacts/qtcontacts-sqlite/contacts.db "SELECT DisplayLabels.displayLabel,Names.firstName, Names.lastName,PhoneNumbers.phoneNumber, EmailAddresses.emailAddress, Contacts.modified FROM Contacts LEFT JOIN DisplayLabels ON DisplayLabels.contactId = Contacts.contactId LEFT JOIN EmailAddresses ON EmailAddresses.contactId = Contacts.contactId LEFT JOIN Names ON Names.contactId = Contacts.contactId LEFT JOIN Nicknames ON Nicknames.contactId = Contacts.contactId LEFT JOIN PhoneNumbers ON PhoneNumbers.contactId = Contacts.contactId WHERE Contacts.collectionId = 1 ORDER BY Contacts.modified DESC;" > $OUT
echo "Exported contacts from sqlite contact backend to $OUT last modified first, as a csv file (comma separated)"
@lduboeuf
lduboeuf / address-book-app.txt
Created November 8, 2022 08:34
address-book-app work with local datas
run address-book-app with the folowing env vars
QTCONTACTS_MANAGER_OVERRIDE=memory
ADDRESS_BOOK_TEST_DATA=absolute_path_to_vcf_file.vcf
to get:
dbus-send --session --print-reply \
--dest=com.canonical.Unity.Launcher \
/com/canonical/Unity/Launcher/dialer_2Dapp \
org.freedesktop.DBus.Properties.Get \
string:com.canonical.Unity.Launcher.Item \
string:'count'
to set:
@lduboeuf
lduboeuf / gist:90f0f00a633555acf2f5126a55303546
Last active June 2, 2022 13:31
Get/Set Account property via dbus
#SET
dbus-send --system --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User`id -u` org.freedesktop.DBus.Properties.Set string:'com.ubuntu.AccountsService.SecurityPrivacy' string:PinCodePromptManager variant:string:ClockPinPrompt
#GET
dbus-send --system --print-reply --dest=org.freedesktop.Accounts /org/freedesktop/Accounts/User`id -u` org.freedesktop.DBus.Properties.Get string:'com.ubuntu.AccountsService.SecurityPrivacy' string:'PinCodePromptManager'
on device:
sudo apt install qt5-qmltooling-plugins
DESKTOP_FILE_HINT=/usr/share/applications/messaging-app.desktop messaging-app -qmljsdebugger=port:1234
on QtCreator (not from clickable):
Create a remote device, device ip
Create a kit with that device
Analyze-> QML Profiler -> select the "device" kit and set port to 1234
0x0000007fb32e8c70 in syscall () from /lib/aarch64-linux-gnu/libc.so.6
#1 0x0000007fb35c3244 in QBasicMutex::lockInternal() ()
from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5
#2 0x0000007fb35c32bc in QMutex::lock() ()
from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5
#3 0x0000007fb37bbe44 in QObject::isSignalConnected(QMetaMethod const&) const
() from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5
#4 0x0000007f9babd7c0 in QtContacts::QContactManager::disconnectNotify(QMetaMethod const&) () from /usr/lib/aarch64-linux-gnu/libQt5Contacts.so.5
#5 0x0000007fb37c5124 in QObject::~QObject() ()
from /usr/lib/aarch64-linux-gnu/libQt5Core.so.5
@lduboeuf
lduboeuf / gist:6318ee3eb4b3cb63645b017e99e9a33b
Last active March 16, 2022 15:40
Music app issue on import
Music app can't play imported file.
The File is well copied but no entry in MediaStore db.
watch inotify events:
inotifywait -rme modify,attrib,move,close_write,create,delete,delete_self /home/phablet/Music/Imported/2021/09/03
QFile::rename + QFile::copy ( actual content-hub code contentItem.cpp/move method )
/home/phablet/Music/Imported/2021/09/03/ CREATE 094451-pikatchu.wav
/home/phablet/Music/Imported/2021/09/03/ MODIFY 094451-pikatchu.wav
/home/phablet/Music/Imported/2021/09/03/ MODIFY 094451-pikatchu.wav