Category Archives: Uncategorized

Installing Code Composer Studio 6 on Ubuntu 14.10 (64-bit)

As of today, Code Composer Studio (ccs) 6 is only available for 32-bit Linux platform.  The good news is that it can be installed on a 64-bit version of Ubuntu and Fedora.

ccs6

In this blog post, I’m going to show a few issues I came across and how to fix them on Ubuntu 14.10 64-bit.

Issue 1:

After the installation, when I ran the ccs, it produces some warning and error messages then quit.

...
java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
    /home/kenno/apps/ti/ccsv6/eclipse/configuration/org.eclipse.osgi/bundles/244/1/.cp/libswt-pi-gtk-4333.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
    no swt-pi-gtk in java.library.path
    /home/kenno/.swt/lib/linux/x86/libswt-pi-gtk-4333.so: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
    Can't load library: /home/kenno/.swt/lib/linux/x86/libswt-pi-gtk.so

The fix [1]:

$ sudo apt-get install libgtk2.0-0:i386

Issue 2:

Now that ccs can be launched, but there are still some warnings.

ccstudio:23614): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",
Gtk-Message: Failed to load module "canberra-gtk-module"

The fix:

$ sudo apt-get install libcanberra-gtk-module:i386

Issue 3:

Here is another warning, which we can get rid of.

(ccstudio:28693): Gtk-WARNING **: Unable to locate theme engine in module_path: "pixmap",

The fix [2]:

$ sudo apt-get install gtk2-engines-pixbuf:i386

Issue 4:

This one is similar to the issue #3.


(ccstudio:28917): Gtk-WARNING **: Unable to locate theme engine in module_path: "murrine",

The fix:

$ sudo apt-get install gtk2-engines-murrine:i386

Issue 5:

This one is something to do with the App Center which only shows a blank page. According to the information found in reference [3], the internal web browser, chromium, could not launch because of missing libudev.so.0.

The fix:

 
$ sudo apt-get install libudev1:i386
$ sudo ln -s /lib/i386-linux-gnu/libudev.so.1 /usr/lib/libudev.so.0

Note that you must use libudev.so.1 provided by the 32 bit package.

References:

  1. http://askubuntu.com/questions/356605/ubuntu-13-10-64-bit-machinarium-error-while-loading-shared-libraries-libgtk-x1
  2. http://askubuntu.com/questions/66356/gdk-gtk-warnings-and-errors-from-the-command-line
  3. http://tools1105.rssing.com/chan-14792965/all_p238.html

Mounting qcow2 VM disk images

From time to time, after applying Windows updates on my Windows 7 kvm-based virtual machine, the machine won’t boot after restarting. In the past, I was lucky to be able to fix it.

Last night, I could not say the same thing. Instead of stressing out losing my hair on how to get it working again, it’s decided to just restore the whole Windows image. First, I need to get some updated data from it though.

In this post, I’ll share a short instruction on how to mount qcow2 disk image to a directory on Fedora 21 so I can get some data out.

modprobe nbd max_part=63
qemu-nbd -c /dev/nbd0 /home/kenno/VMs/kvm/7-32b.qcow2 
mount /dev/nbd0p1 /mnt

Reference: http://alexeytorkhov.blogspot.com.au/2009/09/mounting-raw-and-qcow2-vm-disk-images.html

Good permission for /tmp

I have been having issues getting X2Go running on a CentOS 6.5 box. It took me a while to figure out that the problem laid with the permission of /tmp directory. I’ll write how to solve the X2Go problem in another post.

The recommended permission for /tmp is 1777. Notice that the forwarding ‘1’ is the sticky bit which only allows the owner of the file within /tmp (or the root user) to delete/rename the file.

# chmod 1777 /tmp
# ls -ld /tmp
drwxrwxrwt. 11 root root 4096 Feb 16 11:00 /tmp

Updating Nexus 7 to Lollipop using sideload

This post is a note to remind myself how to manually flash Android firmware on a Nexus device.

Step 1, download the firmware to your computer. I downloaded Android 5 from:
http://www.droid-life.com/2014/11/13/download-android-5-0-ota-update-nexus-5-7-10-4/

Step 2, connect Nexus 7 to the computer. Mine runs Ubuntu 14.10, and I already downloaded Android SDK.
Make sure that “Developer Options” is enabled. If it’s not, go to Settings -> About tablet. Then click on “Build Number” 7 times.

~/apps/android-sdk/platform-tools $ sudo ./adb devices
List of devices attached
0XXd41d425XXXe14 device

Note: If you don’t run ‘adb devices’ with sudo, you’ll see the following message:

error: insufficient permissions for device
error: insufficient permissions for device

If that happens, kill adb service and start adb with sudo:

./adb kill-server
sudo ./adb start-server

Step 3, While the Nexus 7 is still connected, run:

./adb reboot bootloader

Step 4,

To be continue…

Ref: This entry was posted in Tips, Uncategorized and tagged , , on by .

Arduino improving nRF24L01+ reliability

In the past few weeks, I noticed that data transmitting from one of sensor nodes got dropped dramatically. This sensor node is an Arduino Micro using nRF24L01+ as the transmitter.

NRF20L01+

NRF20L01+

Well, it’s suppose to send data to the base station once every 30 seconds; however the transmitting recurrence time exceeded 2 minutes. By default the transmitting rate is at 1MBit/s, so I dropped it to 250KBit/s to see if had any better improvement. It didn’t help.

Fortunately, while searching for an unrelated topic, I landed on this page http://blog.surserv.at/nrf24l01_wireless_modules/ which talked about nrf24l01+ and some issues witht the Arduino libraries I used.

If you have free time, go and read that post; however to jog my memory this is the changed I made in libraries/RF24/RF24.cpp:

333 void RF24::begin(void)
...
357   //write_register(SETUP_RETR,(B0100 << ARD) | (B1111 << ARC));
358   write_register(SETUP_RETR,(B0101 << ARD) | (B1111 << ARC));
...

509 void RF24::startWrite( const void* buf, uint8_t len )
...
513   // [2014-08-12:SS] http://blog.surserv.at/nrf24l01_wireless_modules/
514   //delayMicroseconds(150);
515   delayMicroseconds(500);
...

After the change to the library is made, I recompiled the Arduino sketch and uploaded to the mentioned sensor node. Now, the base station is able to receive data from that node every 30 seconds as expected. Yay!

Eclipse ADT Fatal Error on Linux

The Eclipse IDE that comes bundle with Android Development Tools (ADT) crashes when run on my laptop running Fedora.

ADT

The error message which logged to console is:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000003cc2270061, pid=9653, tid=140330452297472
#
# JRE version: Java(TM) SE Runtime Environment (7.0_55-b13) (build 1.7.0_55-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.55-b03 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libsoup-2.4.so.1+0x70061]  soup_session_feature_detach+0x11
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

Fortunately, there’s a way to fix this problem by opening ‘eclipse.ini’ file, in my case:

vim /opt/adt-bundle-linux-x86_64-20131030/eclipse

and added this line to the end of that file:

-Dorg.eclipse.swt.browser.DefaultType=mozilla

Credit: Android – Solución Fatal Error del IDE Eclipse (ADT)

Can’t find the ‘libpq-fe.h header

I need to install pg 0.17.1 gem on a server running CentOS. This is the error message I saw:

# gem install pg -v '0.17.1'
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

/usr/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.
...

First thing came to my mind was I must have forgotten to install the -dev package.

# yum install postgresql93-devel

Then, when I ran gem command again, suprisingly I still got the same error message. So I checked the explanation in the error message carefully.

# locate pg_config
/usr/pgsql-9.3/bin/pg_config
/usr/pgsql-9.3/share/man/man1/pg_config.1

# gem install pg -v '0.17.1' -- --with-pg-config=/usr/pgsql-9.3/bin/pg_config

This time, pg gem was successfully installed.

Note, if you use bundle to install gem, you’ll need to run this command:

# bundle config build.pg --with-pg-config=/usr/pgsql-9.3/bin/pg_config
# bundle install --path vendor/bundle

Permanently Disable Search Indexing In Windows 8

This post is mainly to remind me how to disable the search indexing.

On the start screen type: services.msc. Once the service dialog windows opened, look for “Windows Search”. Right click on it, and select Properties. In the Startup type drop-down list, select Disabled.

Full credit goes to this link: http://www.addictivetips.com/windows-tips/how-to-permanently-disable-search-indexing-in-windows-8/.

Upgrade existing Perl 5.12 to Perl 5.18 on FreeBSD 9

Recently I’ve been trying to update the perl package on my FreeBSD box to the latest version 5.18 without any success. Here’s a snippet of the error message:

Creating various symlinks in /usr/bin...
    Symlinking /usr/local/bin/perl5.18.1 to /usr/bin/perl
    Symlinking /usr/local/bin/perl5.18.1 to /usr/bin/perl5
Done.
Installing perl5.18-5.18.1_2...pkg-static: perl5.18-5.18.1_2 conflicts with perl-5.12.5 (installs files into the same place).  Problematic file: /usr/local/bin/a2p
*** [fake-pkg] Error code 70
Stop in /usr/ports/lang/perl5.18.
*** [install] Error code 1

Stop in /usr/ports/lang/perl5.18.

===>>> Installation of perl5.18-5.18.1_2 (lang/perl5.18) failed
===>>> Aborting update

===>>> Killing background jobs
Terminated

===>>> You can restart from the point of failure with this command line:
portmaster lang/perl5.18

===>>> Exiting

So I turned to Google to see if other people experienced the same thing as me. According to an answer to a similar question about upgrading perl on serverfault.com, one should read

/usr/ports/UPDATING

document frequently.

Let’s do it.

pkg updating | less
20131023:
  AFFECTS: users of lang/perl5.12 lang/perl5.14
  AUTHOR: mat@FreeBSD.org

  The default perl has been switched to lang/perl5.16. If you're using binary
  packages, you need to do :

  # pkg set -o lang/perl5.14:lang/perl5.16

  If you're not using binary packages and want to (and should) switch, if
  you're using perl-5.14, for instance :

  Portupgrade users:
    0) Fix pkgdb.db (for safety):
        pkgdb -Ff

    1) Reinstall new version of Perl (5.16):
        portupgrade -o lang/perl5.16 -f perl-5.14.\*

    2) Reinstall everything that depends on Perl:
        portupgrade -fr perl

  Portmaster users:
        portmaster -o lang/perl5.16 lang/perl5.14

        Conservative:
        portmaster p5-

        Comprehensive (but perhaps overkill):
        portmaster -r perl-

  Note: If the "perl-" glob matches more than one port you will need to specify
        the name of the Perl directory in /var/db/pkg explicitly.

I’m using Portmaster, and I’d like to upgrade from perl5.12 to perl5.18.

# portmaster -o lang/perl5.18 lang/perl5.12

…and after a very long wait, this was the result:

===>>> Updating dependency entry for perl5.18-5.18.1_2 in each dependent port

===>>> Delete perl/perl-5.16.3.tar.bz2? y/n [n] y

===>>> Delete old and new distfiles for lang/perl5.12
       without prompting? y/n [n] y

===>>> Installation of lang/perl5.18 (perl5.18-5.18.1_2) complete

===>>> Exiting

There you go. If there’s only thing you can take from this post is that if you upgrade packages from sources very often on FreeBSD, you really should check the /usr/ports/UPDATING.

ZFS on CentOS

First we need to add the ZFS on Linux repository to our system by installing a zfs-release package as shown below:

$ sudo yum localinstall --nogpgcheck http://archive.zfsonlinux.org/epel/zfs-release-1-3.el6.noarch.rpm
$ sudo yum install zfs 

Once, zfs has been installed, we can create a storage pool. There’re many RAID configuration to choose from, and I’m not going to get into it. However, if you want to learn more, you can read this ZFS Administration article which explains in great detail about ZFS RAID(Z).

In my case, I have three 1TB disks and pick RAIDZ-1.

# zpool create tank raidz1 sda sdb sdc
# zpool status tank
  pool: tank
 state: ONLINE   
  scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        tank        ONLINE       0     0     0
          raidz1-0  ONLINE       0     0     0
            sda     ONLINE       0     0     0
            sdb     ONLINE       0     0     0
            sdc     ONLINE       0     0     0

Source: