Sunday, June 12, 2011

Unstatsppd: Your Beers Statistics Distribution by Day of Week

As I had some free time on my hands this week-end, and that I wanted to know on which day of the week I most enjoy beer drinking, I fired up my favorite text editor and started unstatsppd.py.

No rocket science whatsoever but an easy mean to gather those statistics and display them using the Google Charts Tools API.

Code is available here: https://github.com/xsa/unstatsppd

Prerequisites:
Here's an output example with my data:

Friday, June 10, 2011

HTC Incredible S, Android, Linux, and udev(7)

So it all started because I wanted to take screen captures of my HTC Incredible S (I will not explain how to do that here as you'll find plenty of good tutorials on the interwebs).

One of the steps involved the Dalvik Debug Monitor Server (DDMS) which provides all kind of things you could expect from a debugging tool, including a screen capture feature.Unfortunately, I quickly noticed that it wasn't really working as expected with my new HTC Incredible S device on my Linux laptop (running RHEL):

$ pwd
/full/path/to/android-sdk-linux_x86/tools
$ ./ddms

(ddms:15838): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 16

(ddms:15838): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 16
09:01:27 E/DDMS: insufficient permissions for device
com.android.ddmlib.AdbCommandRejectedException: insufficient permissions for device
    at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)
    at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
    at com.android.ddmlib.Device.executeShellCommand(Device.java:276)
    at com.android.ddmuilib.SysinfoPanel.loadFromDevice(SysinfoPanel.java:159)
    at com.android.ddmuilib.SysinfoPanel.deviceSelected(SysinfoPanel.java:126)
    at com.android.ddmuilib.SelectionDependentPanel.deviceSelected(SelectionDependentPanel.java:52)
    at com.android.ddms.UIThread.selectionChanged(UIThread.java:1684)
    at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:752)
    at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:740)
    at com.android.ddmuilib.DevicePanel.access$1100(DevicePanel.java:56)
    at com.android.ddmuilib.DevicePanel$1.widgetSelected(DevicePanel.java:357)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
    at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
    at com.android.ddms.UIThread.runUI(UIThread.java:492)
    at com.android.ddms.Main.main(Main.java:103)

09:01:32 W/ddms: Unable to get frame buffer: insufficient permissions for device

Not what I expected, but nothing that cannot be fixed. So after googling/fiddling/ranting a bit, udev(7) came to the rescue. Pretty much, it seems I needed another rule to be added. So here's how I did it:

Look at the information that pertain to my HTC Incredible S:

$ lsusb
Bus 002 Device 006: ID 1267:0210 Logic3 / SpectraVideo plc
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 009: ID 0bb4:0cac High Tech Computer Corp.
Bus 001 Device 005: ID 0a5c:217f Broadcom Corp. Bluetooth Controller
Bus 001 Device 003: ID 17ef:480f Lenovo Integrated Webcam [R5U877]
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub




Create a specific android.rules file in custom rules directory /etc/udev (Note that it is one single line in the .rules file below)

$ id
uid=500(xsa) gid=500(xsa) groups=500(xsa),496(desktop_admin_r)

$ sudo -s

# cat > /etc/udev/android.rules
SUBSYSTEMS=="usb", ATTRS{idVendor} =="0bb4", ATTRS{idProduct} =="0cac", MODE="0660", OWNER="root", GROUP="desktop_admin_r"
^D
# ln -s ../android.rules /etc/udev/rules.d/90-android.rules

Reload the udev(7) rules and then launch again DDMS and you should be all set.

# /etc/init.d/udev-post reload
[...]
# exit
$ cd /full/path/to/android-sdk-linux_x86/tools
$ ./ddms

Friday, April 22, 2011

Daily links for 04/21/2011

Posted from Diigo. The rest of my favorite links are here.

Wednesday, April 20, 2011

Daily links for 04/20/2011

Posted from Diigo. The rest of my favorite links are here.

Tuesday, April 19, 2011

Daily links for 04/19/2011

Posted from Diigo. The rest of my favorite links are here.

Monday, April 18, 2011

Daily links for 04/18/2011

  • "The Tangled Web is my second book, and a lovingly crafted guide to the world of browser security. This is an overcrowded market, but there are two reasons why you may want to care. "
Posted from Diigo. The rest of my favorite links are here.

Thursday, April 14, 2011

Daily links for 04/14/2011

Posted from Diigo. The rest of my favorite links are here.

Wednesday, April 13, 2011

Daily links for 04/13/2011

Posted from Diigo. The rest of my favorite links are here.

Tuesday, April 12, 2011

Daily links for 04/12/2011

Posted from Diigo. The rest of my favorite links are here.

Monday, April 11, 2011

Daily links for 04/11/2011

Posted from Diigo. The rest of my favorite links are here.

Friday, April 8, 2011

Daily links for 04/08/2011

Posted from Diigo. The rest of my favorite links are here.

Thursday, April 7, 2011

Daily links for 04/07/2011

Posted from Diigo. The rest of my favorite links are here.

Wednesday, April 6, 2011

Daily links for 04/06/2011

Posted from Diigo. The rest of my favorite links are here.

Tuesday, April 5, 2011

Daily links for 04/05/2011

Posted from Diigo. The rest of my favorite links are here.

Friday, April 1, 2011

Daily links for 04/01/2011

Posted from Diigo. The rest of my favorite links are here.

Daily links for 03/31/2011

Posted from Diigo. The rest of my favorite links are here.

Wednesday, March 30, 2011

Daily links for 03/30/2011

Posted from Diigo. The rest of my favorite links are here.

Tuesday, March 29, 2011

Daily links for 03/29/2011

Posted from Diigo. The rest of my favorite links are here.

Monday, March 28, 2011

Daily links for 03/28/2011

Posted from Diigo. The rest of my favorite links are here.

Friday, March 25, 2011

Daily links for 03/25/2011

Posted from Diigo. The rest of my favorite links are here.

Thursday, March 24, 2011

Daily links for 03/24/2011

Posted from Diigo. The rest of my favorite links are here.

Wednesday, March 23, 2011

Daily links for 03/23/2011

Posted from Diigo. The rest of my favorite links are here.

Tuesday, March 22, 2011

Daily links for 03/22/2011

Posted from Diigo. The rest of my favorite links are here.