Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Sunday, October 8, 2017

Deploying Jenkins Continuous Integration (CI) Server on Ubuntu LTS

For the past few weeks I have been helping Internet-in-a-Box(IIAB) team develop their Continuous Integration (CI) infrastructure setup using Vagrant, VirtualBox and Jenkins CI server.

Running Jenkins server from .war file might be convenient. But it is recommended to deploy GNU/Linux Continuous Integration (CI) server using these instructions.


# Add Debian package repository of Jenkins GPG key:
$ wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -

# Then add the following entry to your/etc/apt/sources.list:
$  echo deb http://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list

# Update your local package index:
$ sudo apt-get update

# Install Jenkis server:
$ sudo apt-get install jenkins

# Start Jenkins service and verify its status:
$ sudo systemctl start jenkins
$ sudo systemctl status jenkins

# Open http://localhost:8080 in your browser and copy paste in the secret password.
# Follow the on screen instructions to create Jenkins server admin account
$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword

# Open the ports 8080 through your firewall:
$ sudo ufw allow 8080
$ sudo ufw status

Adding a monit service to monitor the Jenkins server is a good idea. Monit ensures that Jenkins server is restarted automatically when it crashes.


# Create a Jenkins monitoring file with following lines with:
$ sudo nano /etc/monit/conf.d/jenkins
check process jenkins with pidfile /var/run/jenkins/jenkins.pid
    start program = "/etc/init.d/jenkins start"
    stop program  = "/etc/init.d/jenkins stop"

Also you'll need to configure mail server to send Jenkins build reports.

Tuesday, September 6, 2016

Animata Open Source Real-time Animation

In my efforts to explore the use of technology in art and social change. Looking at few ideas in creating new media installation art. Following my friend Prayas's advice I first looked at Animata developed by Budapest Kitchen.

The software is not currently in active development. Though I was able to compile it on Ubuntu gnu/Linux machine using the latest code. They were some stability issues.

Animata open source real-time animation software on linux

Here are the instructions to compile and run Animata on Ubuntu LTS.


# Download Animata from https://code.google.com/archive/p/animata/source/default/source

 $ wget https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/animata/source-archive.zip

# Uncompress the archive

 $ unzip source-archive.zip

# Change direction into animata source directory

 $ cd animata/trunk

# Install the dependencies

 $ sudo apt-get install scons
 $ sudo apt-get install libfltk1.1*

# Build

 $ scons

# Run the build

 $ ./build/animata

That's all folks. Please let me know your experiences with Animata.


Friday, September 2, 2016

Testing Unity3D editor on gnu/Linux

Few days ago Unity3D editor support on gnu/Linux reached an important milestone. Thanks to efforts of Na'Tosha Bard and her team, we now have mainline beta builds of Unity3D editor for gnu/Linux operating systems. This has been my long time feature request (Kudos Na'Tosha!).

Now gnu/Linux could become a platform of choice for Indie game developers. Along with Blender for 3D characters design and game environment asset development and Audacity for game audio.

You can download the Unity3D gnu/Linux beta builds in this thread. The latest builds would be in the latest post of this thread, so don't forget to scroll down until you find that last post.



# Download the Unity3D editor .deb package using wget or torrent. 

$ wget -c http://download.unity3d.com/download_unity/linux/unity-editor-5.5.0b1+20160830_amd64.deb
--2016-09-01 19:07:08--  http://download.unity3d.com/download_unity/linux/unity-editor-5.5.0b1+20160830_amd64.deb
Resolving download.unity3d.com (download.unity3d.com)... 175.28.3.10, 175.28.3.16
Connecting to download.unity3d.com (download.unity3d.com)|175.28.3.10|:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 2680067522 (2.5G), 718427586 (685M) remaining [application/x-debian-package]
Saving to: ‘unity-editor-5.5.0b1+20160830_amd64.deb’

unity-editor-5.5.0b1+20160830_amd64.d 100%[+++++++++++++++++++++++++++++++++++++++++++++++++++++===================>]   2.50G   446KB/s    in 22m 36s 

2016-09-01 19:29:44 (517 KB/s) - ‘unity-editor-5.5.0b1+20160830_amd64.deb’ saved [2680067522/2680067522]

# Install the downloaded package using dpkg program 

$ sudo dpkg -i unity-editor-5.5.0b1+20160830_amd64.deb 
Selecting previously unselected package unity-editor.
(Reading database ... 697456 files and directories currently installed.)
Preparing to unpack unity-editor-5.5.0b1+20160830_amd64.deb ...
Unpacking unity-editor (5.5.0xb1Linux) ...
Setting up unity-editor (5.5.0xb1Linux) ...
Setting permissions on chrome-sandbox...
Done.
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160701-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...

# Start Unity3D editor on command line by typing  
$ /opt/Unity/Editor/Unity


You can track various bugs in this Unity3D Linux Editor forum. There are few of well known issues, such the excessive CPU usage bug (lovely nick-named 'Spock') and here.

Please don't forget to share your experiences with testing Unity3D editor on gnu/Linux.

Thursday, August 25, 2016

Blender missing shared library gotcha!

Here is a simple solution to Blender missing 'libavcodec.so.54' shared library on Ubuntu Xenial (16.04.1 LTS) box. There are numerous posts about this problem but very few solutions.


$ blender
blender: error while loading shared libraries: libavcodec.so.54: cannot open shared object file: No such file or directory

Solution for Blender missing library

Let me share what worked for me. Let's try to locate and add the library to ldconf path.


# Install the libavcodec-extra package using apt-get package manager.
$ sudo apt-get install libavcodec-extra-56

# Verify the location of libavcodec.so.54 file path.  
$locate libavcodec.so
/usr/lib/x86_64-linux-gnu/libavcodec.so
/usr/lib/x86_64-linux-gnu/libavcodec.so.56
/usr/lib/x86_64-linux-gnu/libavcodec.so.56.1.0


# Create a new ldconfig file with proper path to the shared library. 
$ sudo nano /etc/ld.so.conf.d/blender.conf

# Add the following line in the file. 
/usr/lib/x86_64-linux-gnu/

# Rerun ldconf 
$ sudo ldconf 

# Start blender normally. 
$ blender  


That's all folks!. Enjoy blender.

Wednesday, August 5, 2015

Mirroring gnu/Linux screens on command line

It's my turn on stage. Smiling broadly I walk over to the stage with my computer. I worked hard on my slide-deck and pre-loaded all the webpages just in case the Internet connectivity failed. Connect my computer with a VGA cable to the projector and realize that I need to mirror my screen. So that the audience could see my computer screen on projector. That should be easy to do. So I open my computers display settings on Gnome control center and hunt for the 'mirror the screens' option. I can feel scores of eyes follow my every move. There is no option to mirror the display screens, I break into a cold sweat. I regret not saying a prayer to the demo gods.

Miracles happens, my fellow presenter Yang was my guardian angel. He had one trick up his shelve. He took the computer and typed this magic command into the terminal.


xrandr --output VGA1 --same-as LVDS1

That worked! I wipe the sweat and thank Yang profusely. Now it's show time.

Saturday, July 25, 2015

Restoring Nexus 4 Factory Image

Something terribly went wrong during Android 5.1.1 Over The Air (OTA) update. The Nexus 4 mobile phone stuck in the boot loop after update. Perhaps the update failed to download the files or the device ran out of disk space. For those of you who like to debug such problems, I captured some logs for analysis with 'adb logcat' here (1,2,3,4).

Caution: Flashing a new factory image deletes all user data. Be certain to first backup any personal data such as photos.

Tools: What do you need to restore the phone?

For this tutorial I'll use a gnu/Linux computer with Android SDK Stand-alone Tools installed. We'll use the 'fastboot' program to flash the Android Nexus 4 devices with factory images from developer.android.com/nexus/images.

  1. Download Android SDK Stand-alone tools from developer.android.com.
  2. Uncompress the Android SDK to your /opt/android-sdk-linux directory.
  3. Add Fastboot to your system path
    
    $ ln -sf /opt/android-sdk-linux/platform-tools/fastboot /usr/local/bin/fastboot
    
  4. To get Fastboot working on gnu/Linux I added the follow line to /etc/udev/rules.d/51-android.rules .
    
    $ sudo nano /etc/udev/rules.d/51-android.rules 
    
    # adb protocol on mako (Nexus 4 debug)
    SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1",ATTR{idProduct}=="4ee2", MODE="$
    
  5. Restart udev service.Connect the Nexus 4 device to computer with USB cable and see fastboot can access it.
    
    $ sudo service udev restart 
    $ sudo fastboot devices
    
  6. Unlock the Nexus 4 phone (Optional step). The phone will reboot and follow the instructions on the phone screen to unlock the phone.
  7. $ fastboot oem unlock 
  8. Let's put the Nexus 4 in recovery mode so that we can flash the new factory image. You can use 'adb' command or press hold volume up + volume down + power buttons during the phone bootup.
      
    $ adb reboot bootloader
    
  9. Download the Nexus 4 factory image from developers.google.com/android/nexus/images. I have downloaded the Android 5.1.0 (LMY47O) factory image. Uncompress it the downloaded file and excute the 'flash-all.sh' script to flash the factory image.
    
    $ tar zxvf occam-lmy47o-factory-cae68e81.tgz 
    
    $ cd occam-lmy47o/ 
    
    $ sudo ./flash-all.sh 
    

Whew! That's all folks! Now you get enjoy the Nexus device with brand new factory image.

Sunday, May 17, 2015

Build Retro Gaming Console with Raspberry Pi PiPlay Gaming OS

In this post I take a journey into the past and relive the days of arcade games. My colleagues at the Hackerspace Phnom Penh decided to make a game arcade using Raspberry Pi running PiPlay (formerly called PiMAME) and couple of old Xbox controllers.

What you need?

  • Raspberry Pi
  • 8GB or 16GB SDCard
  • USB Wifi adapter
  • Two Xbox Controllers
  • Keyboard
  • Powered USB Hub
  • Female-to-Female USB cable
  • HDMI Cable
  • TV

Download the PiPlay 0.8.0 Beta 6 image. The Raspberry Pi can't power all peripherals. You'll need a compatible powered USB hub to power both Raspberry Pi and Xbox controllers. The additional USB slots on the hub could used to connect keyboard during configuration.



# Download the latest PiPlay SD Card.

$ unzip ~/Downloads/piplay-0.8-beta6.img.zip
Archive:  ~/Downloads/piplay-0.8-beta6.img.zip
  inflating: piplay-0.8-beta6.img

# Write to card using unetbootin or dd command. Be Patient, This process takes some time.
$ sudo dd if=./piplay-0.8-beta6.img of=/dev/mmcblk0 bs=1M

# Boot the Raspberry Pi. The default username and password is 'pi' and 'raspberry'.
# Use 'raspi-config' to expand the file system.
# (Optional) While you are at it, You might want to configure timezone change keyboard layout as well.

$ sudo raspi-config

# Configure Wifi using command-line or visual tools http://raspberrypihq.com/how-to-add-wifi-to-the-raspberry-pi/

# If you don't get any sound over HDMI: Try adding the following line to /boot/config.txt

$ sudo nano /boot/config.txt
hdmi_drive=2

#Download some game ROMs and upload them to Raspberry Pi. 

More instructions about the setup are on my HackADay.io Gaming Console with Raspberry Pi PiPlay page.

Game on, Fight!

Wednesday, May 13, 2015

Quake style drop down terminal for Gnome-Shell

Have you ever craved for Quake style drop down terminal?. In this post I'll share how to setup one on Gnome-shell desktop. Let's get started by installing the Drop down terminal extension from extensions.gnome.org. Let's test if it works. Press '~' to active the drop down terminal. Usually U assign 'Alt+F12' hotkeys on my computer. Here is the video of drop down terminal in action.

Let's customize the drop down terminal to launch in full screen mode. In the extension preferences I have set the terminal height to 800px. You have play around with transparency settings to show the underlying windows.

Gnome-shell Drop down terminal extension settings

Another good customization is to launch tmux. You can do this by setting custom command to run instead of launching the default shell.

That's it folks! Now you can enjoy the Quake style drop down terminals on Gnome-shell. Here is video of my setup.

Friday, December 26, 2014

Server Monitoring with Monit Tutorial

As you sit down for a lovely Christmas dinner with family and friends, your phone rings. The frantic client is on the line shouting that the server just went down. Don't you wish you had a helpful program that automatically monitors and restarts the servers automatically.

Monit is an open source process supervision program that monitoring your server processes and restarts failed services. It is easy to setup and relatively painless to use.

Here is a quick tutorial to configure Monit to monitor Apache and MySQL servers.


$ sudo apt-get install monit 

# Monit Configuration settings
$ sudo nano /etc/monit/monitrc 
  set daemon 60 
  set logfile /var/log/monit.log
  set idfile /var/lib/monit/id
  set statefile /var/lib/monit/state
  set eventqueue
  set httpd port 2812 and
   use address localhost
   allow localhost
   include /etc/monit/conf.d/*

# Create Apache2 monitoring file 
$ sudo nano /etc/monit/conf.d/apache2 
check process apache with pidfile /run/apache2.pid
    start program = "/etc/init.d/apache2 start" 
    stop program  = "/etc/init.d/apache2 stop"


# Create  MySQL monitoring file
$ sudo nano /etc/monit/conf.d/mysql 
check process mysqld with pidfile /var/run/mysqld/mysqld.pid
    start program = "/etc/init.d/mysql start"
    stop program = "/etc/init.d/mysql stop"

# Check monit configuration for syntax errors 
$ sudo monit -t 


# Start Monit daemon
sudo service monit start 

# Check Monit status 
$ sudo monit status
The Monit daemon 5.3.2 uptime: 4m 

Process 'mysqld'
  status                            Running
  monitoring status                 Monitored
  pid                               2676
  parent pid                        1
  uptime                            4d 8h 1m 
  children                          0
  memory kilobytes                  256380
  memory kilobytes total            256380
  memory percent                    12.5%
  memory percent total              12.5%
  cpu percent                       0.0%
  cpu percent total                 0.0%
  data collected                    Wed, 10 Dec 2014 08:43:13

Process 'apache'
  status                            Running
  monitoring status                 Monitored
  pid                               4230
  parent pid                        1
  uptime                            4d 8h 1m 
  children                          27
  memory kilobytes                  11556
  memory kilobytes total            391484
  memory percent                    0.5%
  memory percent total              19.1%
  cpu percent                       0.0%
  cpu percent total                 0.0%
  data collected                    Wed, 10 Dec 2014 08:43:13

System 'system_foobar.org'
  status                            Running
  monitoring status                 Monitored
  load average                      [0.00] [0.01] [0.05]
  cpu                               0.0%us 0.0%sy 0.0%wa
  memory usage                      666736 kB [32.6%]
  swap usage                        140 kB [0.0%]
  data collected                    Wed, 10 Dec 2014 08:43:1

That's all folks! Now you have a wonderful Christmas!

Sunday, October 26, 2014

Gnome 3 Massive Title Bar Solution

Upgraded to Ubuntu 14.10 (Utopic Unicorn) this weekend. The upgrade process went without a hitch and latest Gnome 3.12 desktop experience is good except for this massive title bar issue. Reblogging Mikey's solution for this minor Gnome 3 annoyance. Thanks Mikey!.



$ sudo sed -i "/title_vertical_pad/s/value=\"[0-9]\{1,2\}\"/value=\"0\"/g" /usr/share/themes/Adwaita/metacity-1/metacity-theme-3.xml

Gnome 3 Desktop screenshot image with large title bar

Before

Gnome 3 Desktop screenshot image with normal title bar

After


Reported the bug, Please feel free to track the bug #1385597 and provide your feedback.

Saturday, May 31, 2014

Skype Audio Quality Issues in gnu/Linux

Skype is an essential tool for a digital nomad. In some versions of gnu/Linux, you'll notice considerable audio quality issues and disturbance (white noise) in Skype. Had to resort to using Skype on Android until I found this solution on Skype community forum.

Run this command in the terminal to start Skype. You'll notice significant improvement in the audio quality.


$ PULSE_LATENCY_MSEC=30 skype

Happy Skyping!



Wednesday, April 23, 2014

Find the fastest DNS Servers with NameBench

In my last post I talked about configuring static DNS entries. Let's go about choosing the fastest DNS servers near your location using Namebench. This tool helps you find the fastest DNS server based on web history, tcpdump output and standardized datasets. You can install it from your package manager or download from code.google.com/p/namebench/.

Namebench DNS benchmarktool screenshot

Here is the list of fastest DNS servers near Nairobi. Tests were run from Zuku Internet connection on Ngong Road, Nairobi

Recommended DNS configuration (fastest + nearest) Nairobi, Kenya

  • Primary Server: 216.194.28.69 (MetConnect-2 US)
  • Secondary Server: 8.8.8.8 (Google Public DNS)
  • Tertiary Server: 78.143.192.10 (Fast GB)

Sunday, April 20, 2014

Configure Static DNS Entries in Ubuntu

Here is quick tip to configure custom DNS services like OpenDNS and Google Public DNS servers on gnu/Linux. Using custom DNS services offers performance benefits and enhanced security.

Append add 'dns-nameservers' to your /etc/network/interfaces file. This over-rides the DNS servers assigned by the DHCP service.


dns-nameservers  208.67.222.222 208.67.220.220

Happy Browsing!

Wednesday, March 26, 2014

Managing Configuration files with etckeeper

Managing your /etc configuration files using version control is a good practice. Trust me, someday this will save your skin.

In the post I'll share setup notes for using etckeeper with git version control. You can install etckeeper and git using system package manager.


# Initialize etckeeper
sudo etckeeper init 

# Commit all your /etc/ configurations into git
sudo etckeeper commit '...enable etckeeper...'

# Check the commit history of file 
$ sudo git log /etc/passwd
commit 322b63ede6cf3073a8f48a883b49d5b3b60fdfb9
Author: arky <arky@localhost.localdomain>
Date:   Wed Mar 5 07:11:47 2014 +0000

    ...enable etckeeper...


There is very little etckeeper documentation out there. You can learn more from this dated Ubuntu Server 10.04 etckeeper wiki page.

Wednesday, January 15, 2014

Ubuntu Adobe Reader 9 Firefox Plugin Annoyance

Launching Firefox web browser on Ubuntu produces these debug files C:\nppdf32Log\debuglog.txt. It is quite annoying especially when developing Firefox Add-ons with Add-on SDK, I have to remove these debug files before committing my sources.

The Adobe Reader 9 plugin is source of this annoying problem. I usually remove the plugin and forget about it. However Robert Fleming provided a better solution.


$ cat C\:\\nppdf32Log\\debuglog.txt 
NPP_GetValue is called
NPP_GetValue is called
NPP_GetValue is called
NPP_GetValue is called
NPP_GetValue is called
NPP_GetValue is called
NPP_GetValue is called
NPP_GetValue is called
NPP_GetValue is called

Save this python program and run it with sudo to fix the problem.


#! /usr/bin/python3
# 
# Save and Run as:
# "sudo ./fix_nppdf.py /opt/Adobe/Reader9/Browser/intellinux/nppdf.so"
#

import mmap, sys

target = br'C:\nppdf32Log\debuglog.txt'
replacement = br'/dev/null'
replacement += b'\0' * (len(target) - len(replacement))

with open(sys.argv[1], 'r+') as f:
  m = mmap.mmap(f.fileno(), 0)
  offset = m.find(target)
  assert offset != -1
  m[offset:offset+len(target)] = replacement

Sunday, January 5, 2014

Using Sugar Learning Platform on Ubuntu

Sugar makes learning fun. There are many activities that encourage children to develop critical thinking skills. The Sugar user interface was developed for One Laptop Per Child (OLPC) project.

In this blog post, I'll share instructions to setup Sugar as alternative desktop environment on Ubuntu. Perhaps schools will adopt this setup to provide different desktop environment for students of various ages groups. At home, parents can share the home computer with their children.

Installing the Sugar Environment

These instructions were prepared on Ubuntu gnu/Linux 13.04 operating system. Please read this wiki page for further instructions.

# Download the sweets installer shell script 
$ wget ftp://download.sugarlabs.org/packages/sweets-distribution.sh

# Add executable bit to the script
$ chmod +x sweets-distribution.sh

# Run the scripts with sudo program. 
$ sudo ./sweets-distribution.sh 

# Check the status of 'sweet-distribution' program.
$ sweets-distribution status
Platform:
   Ubuntu-13.04

Selected repository:
   Factory

Packages to sync:           
   (import GPG keys)

Available repositories:
   0.94:SugarNetwork            
   Factory

-- Hint: Use "sync" command to synchronize packages

# Select 'Factory' as default distrubution channel.
$ sudo sweets-distribution select Factory

# Download the package descriptions. 
$ sudo sweets-distribution sync 

# Now install all the packages using apt-get package manager.
$ sudo apt-get install sweets-desktop

# Test the deployment by launching Sugar emulator.
$ sweets-sugar-emulator

Unfortunately there aren't many Sugar activities packaged for Ubuntu. Let's start with installing browse activity. Download browser activity and save to your ~/Documents folder or external flash drive. To install open the downloaded .xo file with Journal activity in the Sugar emulator.

You can now use the browse to download and install more activities from activities.sugarlabs.org. You can learn more about installing activities by reading the Sugar manual.

That's all. Now you can select Sugar at the graphical login screen. Do share your experience using Sugar Learning Platform.

Monday, January 28, 2013

Speeding Up Software Rebuilds with CCache

Software developers who routinely rebuild large projects would love ccache. Ccache is a compiler cache. It speeds up software rebuilds by caching the result of previous compilations and detecting when the same compilation is being done again.

I use ccache when compiling Linux kernel, Debian/Ubuntu packages, GNOME applications, Mozilla Firefox, FirefoxOS and Android operating system. You could enable ccache by prefixing ccache to your compilation command or update your system path to include ccache.


# Add the following line to your ~/.bashrc file 
export PATH=/usr/lib/ccache:${PATH}

Alternatively you could create symlinks in ~/bin directory. GNOME 3 jhbuild documentation provides a bash script for this purpose.


cd ~/bin
for cmd in cc gcc c++ g++; do
  ln -s /usr/bin/ccache $cmd
done

To take advantage of ccache while building Mozilla Firefox, append the following line to your .mozconfig.


ac_add_options --with-ccache

If you are compiling Android(ASOP), CyanogenMod or Firefox OS. Android build system includes the ccache program, set the USE_CCACHE environment variable to enable ccache.

$ export USE_CCACHE=1

Further more in-depth information, read the ccache manual page. Please do comment and share your experiences using CCache.






Sunday, May 20, 2012

Samsung Galaxy S2 Accessories For Presentations

In this post we'll explore some effective presentations techniques using Samsung Galaxy S2 accessories. Use the Droid@Screen (See this blog post) program to display the mobile phone screen on my computer during my presentations. This program works by taking a continues series of screenshots of the phone screen. There are some problems with this design, there is noticeable delay during application interaction and the video performance is not great on my Lenovo X120e Ubuntu computer.

You can not demonstrate audio and video capabilities of the mobile phone using such software. Planning to give a talk about using Firefox Mobile with Android 4 screen-reader and existing solutions doesn't work for me.

Samsung Galaxy S2 HDTV Adapter

This adapter allow you to plug in your phone directly into HDMI large displays and digital projectors. The mobile phone AC charger powers the adapter and no additional audio cable is needed. The Samsung HDMI adapters are available for Samsung Galaxy phones and tablet models.

This works really great if you are planning to setup large screen display in a exhibition booth. Connect the phone to large screen display with HDMI cable and play your video demo in a loop.


Samsung Galaxy S2 Power Pack

The Samsung Power Pack comes handy when phone runs out of battery in the middle of the presentation. It does extend the battery life of the phone during the presentation or an extending application testing session.

Few caveats using these accessories. The HDMI adapter will not work when the phone is attached to the power pack .

This power pack has some issue with power sensing, sometimes it starts and stops charging with annoying beeps every 10 seconds. And you need to press locking mechanism tight to get the phone to charge. Hope someone at Samsung fixes this problem.



Thursday, May 17, 2012

Unset Google Chrome as default browser on Ubuntu

Update: After further investigation, I found is the problem is in google-chrome application not in Chromium-browser. My Mistake!

Dietrich Ayala brought this problem to my attention. For some reason google-chrome browser constantly makes itself the default browser on Ubuntu 10.10 and later versions. This is annoying when you are testing Firefox Nightly Ubuntu builds. You can choose to remove the google-chrome, but that is not a solution.

First, I tried to reproduce this problem on multiple Ubuntu machines. To reproduce this problem, installed Firefox nightly using Firefox Nightly PPA. Remove any other browsers expect google-chrome.


It took very long time to find the solution to this problem. The chromium-browser package adds /usr/local/share/applications/mimeinfo.cache which supersedes the default system application settings. The solution is edit this file and make it read-only using chattr command.


$ sudo nano /usr/local/share/applications/mimeinfo.cache 
[MIME Cache]
application/earthviewer=google-earth.desktop;
application/keyhole=google-earth.desktop;
application/vnd.google-earth.kml+xml=google-earth.desktop;
application/vnd.google-earth.kmz=google-earth.desktop;
application/xhtml_xml=google-chrome.desktop;
text/html=google-chrome.desktop;
text/xml=google-chrome.desktop;
x-scheme-handler/ftp=google-chrome.desktop;
x-scheme-handler/http=google-chrome.desktop;
x-scheme-handler/https=google-chrome.desktop;

#Remove all the google-chrome entries, like this.
[MIME Cache]
application/earthviewer=google-earth.desktop;
application/keyhole=google-earth.desktop;
application/vnd.google-earth.kml+xml=google-earth.desktop;
application/vnd.google-earth.kmz=google-earth.desktop;

# Make it read-only even for super-user
sudo chattr +i /usr/local/share/applications/mimeinfo.cache





After making these changes. Open Firefox Nightly and make it the default browser. Now this system setting will remain unchanged.


Wednesday, May 16, 2012

Getting Started with Arduino in Hanoi

Spent the weekend learning basic electronics with Arudino open source prototyping platform. La 4uatrieme creative lab organized a two day Arduino workshop in Hanoi.

Designer and teacher Eoin Kinsella delivered a very interactive workshop. We learnt basic electronics, Arduino hardware and software environment by tinkering examples from the popular Getting Started with Arduino book. We spent the day building simple prototypes with sensors, switches and LED's on solderless breadboard and programed it using Arduino development environment.

The Arduino IDE on Linux is not well tested. During the workshop I found a minor bug in Arduino package in Ubuntu and fixed it right away.

Arky with Arduino LED circuit

The inexpensive Arudino hardware makes it easy to build interaction design and physical computing prototypes. With 3D printing services such as Shapeways you can now bring your ideas to life much faster than ever.

You can buy Arduino hardware in Vietnam from Soatec (www.sotatec.com) in Ho Chi Minh city.

Watch Arduino The Documentary (2010)

Popular Posts