few ways to interact with PiGlow api

After Victor Palau wrote a new blog for his PiGlow API snap, I tried to operate PiGlow LED and learnt following ways to interact with it.

a. Use python:

python3 -c 'from urllib.request import urlopen; print(urlopen("http://REALIP:8000/v1/on", data=b""))'

b. Use curl:

curl -i -X POST "http://REALIP:8000/v1/on"

c. Use html web page in web browser

<title>test piglow</title>
<form action="" method="post">
<input type=submit value=flare>

run Snappy on Virtualbox

In case you want to play snappy but don’t have a Raspberry Pi 2 or other hardware…

1, sudo apt-get install virtualbox
2, download snappy image http://cdimage.ubuntu.com/ubuntu-snappy/15.04/20150423/ubuntu-15.04-snappy-amd64-generic.img.xz
3, unxz ubuntu-15.04-snappy-amd64-generic.img.xz
4, VBoxManager convertdd ubuntu-15.04-snappy-amd64-generic.img snappy.vdi –format VDI
5, launch Virtualbox GUI app, create a new VM, OS type is Linux, Version is Ubuntu 64bit, memory is 512MB, Hard driver use an exist virtual hard disk file and select snappy.vdi we just converted from img file.
6, in Settings->Network, change Network Adapter from NAT to Bridged Adapter
7, Start VM, you can use browser to access Snappy App Store by url “webdm.local:4200” or login in from console or ssh with username/password ‘ubuntu/ubuntu’ to do anything fun snappy things like update/rollback

How to enable WIFI and Bluetooth on ONDA V116w Core-M 2-in-1 Tablet

1, Install Ubuntu 14.04 or 15.04 on ONDA V116w.
2, Plug ethernet cable
3, sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get install build-essential git
4.1, git clone https://github.com/lwfinger/rtl8723bu
4.2, cd rtl8723bu
4.3, make
4.4, sudo make install
5.1, git clone https://github.com/lwfinger/rtl8723au_bt
5.2, cd rtl8723au_bt
5.3, ‘git checkout new’ for kernel 3.18 and later
5.4, make
5.5, sudo make install
5, add ‘8723bu’ and ‘btusb’ in /etc/modules

How To Program Unity Scope and Tips

  1. start from official tutorial http://developer.ubuntu.com/scopes/tutorial/

    1. implement search function

    2. implement preview function

    3. modify data/XXXX.scope

    4. modify data/unity-scope-XXXX.service.in

    5. modify XXXX.pro

    6. build executable file, and dbus service file out

    7. install executable file, scope file and service file.

    8. killall unity-scope-home to restart the Home scope so that it loads the new scope

  2. what’s scope? what’s master scope?

    1. Scope

The search engine itself, talking to a web service or a local database. It can be exposed to the user in two ways in the Dash: as a standalone scope or as part of a master scope.

  1. Master scope

The architecture used to merge multiple scopes in the same Dash view.

  1. how to debug?

    1. use libunity-tool -g

  2. My first scope project

    1. lp:~sangshuduo/+junk/scope500px


  1. BKMs and tips

    1. recommend C language to programming scope for performance although python and vala still working

      1. http://askubuntu.com/questions/310669/what-programming-languages-are-scopes-written-in

    2. Ubuntu SDK do not show Unity Scope project in project list

      1. apt-get remove all QT related packages and reinstall Ubuntu SDK

    3. dbus name limitation

      1. https://bugs.launchpad.net/libunity/+bug/1269256

    4. unreliable libunity-tool

      1. sometime libunity-tool can’t list all running scopes’ dbus name. we can fill its group name and unique name manually

      2. use master scope to list all results.

    5. manually add headers path and libraries to link

      1. XXXX.pro

    6. check name matched in all place

      1. config.h

      2. data/XXXX.scope

      3. data/unity-scope-XXXX.service.in

    7. who familiar Unity API

      1. Michal Hruby (mhr3)

    8. build and install. some files will be not installed if only run ‘sudo make install’

      1. qmake

      2. make

      3. sudo make install

dualboot Android and UbuntTouch

I followed the link [1] of linuxjournal to make my Nexus 7 can boot up Android and Ubuntu Touch without reflash system. Now I can easy show off Ubuntu Touch to my friends and read ebook by Kindle for Android now. I’m interested what solution will be  used for dualboot on Ubuntu Edge or its successor.


[1]: http://www.linuxjournal.com/content/multi-booting-nexus-7-tablet?page=0,0