TeamCity – Continuous Integration for Everybody

TeamCity – Continuous Integration for Everybody

TeamCity - Continuous Integration for Everybody

TeamCity – Continuous Integration for Everybody

I’m writing this article in English, even my English is not that good :p. The main reason is because the audience of this article is supposed to be my colleague. I will write the article on my blog first to share with the world ^_^ and then I will copy the article to our company’s forum for our internal documentation. For several article ahead, we will discuss about how can we use a “Continuous Integration” system in to support our SDLC.

If you came from Java (Programming not Island :D), maybe you are familiar with Jenkins (Jenkins-CI). Both are similar tools, written in Java, and available for Linux, Windows and Mac OS X.But how does Continous Integration (CI) works? Here is the figure:

Continuous Integration - Summary of Steps

Continuous Integration – Summary of Steps

  1. Developers work to transform the requirements or stories into source code using the programming language of choice.
  2. They periodically check-in (commit) their work into a version control system (VCS)
  3. The CI server is polling the VCS for changes. It initiates the build process when it encounters a change. The build is executed using a dedicated tool for the job such as Maven, Ant or Rake etc. Depending upon the language used, the source code may need to be compiled.
  4. Static analysis is performed on the source code, to ensure compliance with coding standards and to avoid common causes of bugs.
  5. Automated unit tests are executed.
  6. The percentage of the production code exercised by the unit tests is measured using a coverage analysis tool.
  7. A binary artefact package is created. At this point we might want to assist derivation and provenence by including some additional metadata with the artefact e.g. a build timestamp, or the source code repository revision that was used to produce it.
  8. Prepare for functional testing by setting up the test fixtures. For example, create the development database schema and populate it with some data.
  9. Prepare for functional testing by provisioning a test environment and deploying the built artefact.
  10. Functional tests are executed. Post-execution, tear down any fixtures or environment established in 8 and 9.
  11. Generate reports to display the relevant metrics for the build. E.g. How many tests passed? What is the number and severity of coding standard violations?
  12. The process is continuous of course! So rinse…and repeat….

Source Article

For the next series of this tutorial, first of all we will define the scope by using real case example. Maybe not all of the step we’re implemented right now but most of them will done.

To Be Continued …

LG Vortex VS660 Custom ROM

LG Vortex VS660 Custom ROM

LG Vortex VS660 (Vortex) consider as CDMA version of LG Optimus One (O1) that bundled with Verizon Wireless. Vortex is not alone in LG’s CDMA line up, there are also Optimus S (Sprint) and Optimus M (Metro PCS).

You might guess that Vortex name could be Optimus V, but I like Vortex better :-). This LG’s line-up series has similar hardware and Android version.

Since I’m not subscribed to Verizon service, I didn’t get any update on my device. Not even to Android 2.2.1 version. Lucky for me, bloodxxsyndicate provide nandroid backup of his ROM based on Android 2.2.1 update. That was a good start until then I found Custom Rom “Breakneck” for LG Vortex for further.

Having both ROM (version 2.2.1) as start, I’m working on my own version of 2.2.1 ROM. I want a clean version (without resource modification) of Custom ROM that result would be nearly similar to factory default version except this are already deodexed and optimized. We can all start developing our own customized ROM based on this, and the best part of it, it’s available to everybody, not just Verizon customers. And here I present:

Vorbrain ROM V1d for LG Vortex VS660
(Click to Download)

Download Patch (20110606) : AMR Playback Fix
(amr_playback_fix.zip – apply after update)

UPDATE:
The download link is not available anymore because the site that was hosting the download files has down.

What did you get on this ROM:

  1. Latest Update (20110604)

  2. Clean ROM (Keeping APK’s Dependencies)

  3. ROM Base 2.2.1 (Rooted Already)

  4. Deodexed both for Application and Framework

  5. Optimized and zipaligned all APK’s

  6. JIT Enabled + Increase Heap Memory Size

  7. Remove All Bloatware

  8. Overclockable Kernel

  9. Bundled w/ Google Search & Maps

  10. More space on /data (Google Update is already bundled!)

How to Install:

  1. Your device has to be rooted first! If you’re came from stock 2.2 Android version, then you are lucky, just use z4root to do this.

  2. Because this are ZIP update packages, you must apply custom recovery menu to do ZIP flash update. I would recommend this link and please follow the instruction carefully. The custom recovery image for your Vortex is: recovery-RA-vortex-2.2.1-GNM.img

  3. I’m not writing about steps to apply above mod because it’s already well-documented on creator’s page. I also didn’t include any of those requirements in this article on purpose to honor the creator’s request, not to hot-linked the download part in any means.

  4. If you already download the update package on above link, put downloaded ZIP package on the root of your SD Card and apply ZIP flash update from recovery menu.

  5. Enjoy the ROM!

I would like to thanked to all guys that provide me the ingredients to made this ROM, include great  tools they’re provide to help me with pack-repack, deodexing and optimizing process.

If you like my job, please consider to buy me a snack and coffee 😀 If you give me a lot, I’ll share with those guys I’ve mention 🙂

Android-x86 Installed on SD-Card in 10 Steps

Android-x86 Installed on SD-Card in 10 Steps

As we already know, Android-x86 project is a project to port Android open source project to x86 platform. Basically it could runs on any x86 machine but many people use it on Netbook computer. That’s also what I did on my ASUS EeePC T101MT.

Asus EeePC T101MT comes with dual boot Windows 7 Starter and ASUS Express Gate (based on Splashtop). It’s so risky to install Android-x86 or any other Linux based distribution to hard drive because it has hidden recovery partition that we doesn’t want to mess with it.

In this case, I use 2 GB SD Card to store Android-x86 2.2 OS that I installed from bootable flash drive and modified it’s GRUB configuration so even we setup Card Reader as primary boot device from BIOS, we still able to boot to another OS on hard drive from GRUB menu.

In fact, this is the safest way to install (not live session) Android-x86 without messing up your configuration.

How We Could Achieve This?!

Requirement:

  1. UNetbootin, Flash Drive, SD Card and Android-x86 2.2 ISO Image.

  2. BIOS that capable to boot from Flash Drive and Card Reader.

Installation:

The detail about installation process has perfectly described here. But in order to accomplish our purpose in this tutorial, please follow this steps:

  1. Follow the instruction about how to make Android-x86 bootable Flash Drive using UNetbootin on that link. The point is, you should make a bootable media (CD-ROM or Flash Drive) from Android-x86 ISO image.

  2. Before we start, put your SD Card into your Card Reader and keep your Android-x86 bootable Flash Drive plugged-in.

  3. Restart your Netbook and enter BIOS Configuration Setup and make sure HDD Boot Order similar to this: Flash Drive –> Card Reader –> HDD.

  4. Boot your Android-x86 Flash Drive and enter installation procedure.

  5. Caution: When you chose installation partition during the process, use Card Reader (your SD Card) as target partition. Please notice that Card Reader drive usually recognize as sdc1 FAT32 Card Reader.

  6. Format your SD Card as FAT32 (don’t chose another) and select “Yes” when you asked about GRUB installation.

  7. If asked, make 512 MB user data image and 1024 MB fake SD Card image. You may customize this value as you want.

  8. After reboot, re-enter BIOS Configuration Setup and make sure your Card Reader at the first boot order.

  9. If your Windows partition is not listed on GRUB menu, don’t worry! Just boot into Windows (don’t forget to change your boot order to HDD) and edit menu.lst  (GRUB’s Configuration) located on SDCardDrivegrubmenu.lst and add this line:

    title Windows 7 Starter EeePC
    rootnoverify (hd1,0)
    chainloader +1

    Change the title as you want but please note that I use rootnoverify (hd1,0) and not rootnoverify (hd0,0) as told by lot’s of example, because in my configuration, when we boot from Card Reader, my Card Reader drive became the first drive on system (hd0,0).  So it’s necessary to change those value to (hd1,0) which means, my Windows bootable partition located on second harddrive at the first partition. Here’s my complete menu.lst for example:

    default=0
    timeout=5
    root (hd0,0)
    splashimage=/grub/android-x86.xpm.gz
     
    title Windows 7 Starter EeePC
    rootnoverify (hd1,0)
    chainloader +1
     
    title Android-x86 2.2 (HDPI)
    kernel /android-2.2/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode DPI=240 SRC=/android-2.2 SDCARD=/sd/sdcard.img
    initrd /android-2.2/initrd.img
    
    title Android-x86 2.2 (MDPI)
    kernel /android-2.2/kernel quiet root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode DPI=160 SRC=/android-2.2 SDCARD=/sd/sdcard.img
    initrd /android-2.2/initrd.img
    
    title Android-x86 2.2 (Debug mode)
    kernel /android-2.2/kernel root=/dev/ram0 androidboot_hardware=eeepc acpi_sleep=s3_bios,s3_mode DEBUG=1 SRC=/android-2.2 SDCARD=/sd/sdcard.img
    initrd /android-2.2/initrd.img
  10. After all set, make your Card Reader as your first boot device and you can enter your Windows session by picking first list on GRUB menu.

Please remind that do this at your own risk, I’m not responsible for any data lost or hardware damage because of any failure. Just be careful and backup your data first if you’re not sure you can do it right! 😉

FFmpeg Tips & Trick

FFmpeg Tips & Trick

According to it’s official site, FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. I personally use it for doing video conversion for my mobile phone and dvd player. I made some bash scripts that can help us to work with those tasks.

cut-video.sh

#!/bin/bash
ffmpeg -i "$1" -sameq -acodec copy -vcodec copy -ss "$2" -t "$3" "cutted-$1"

How To Use:

cut-video.sh videofile startpos length

Example:

$ cut-video.sh video.mp4 00:00:00 00:05:00

The example told the script to cut video.mp4 start from beginning for five minutes length. The result will saved on same directory with “cutted-“ prefix.

mp4-mobile.sh

#!/bin/bash
ffmpeg -i "$1" -s 480x320 -aspect 4:3 -r 15 -b 512k -ab 128k -ac 2 -ar 44100 -acodec aac -vcodec mpeg4 -strict experimental "$2"

Note: Make sure to put all ffmpeg syntax above in one line! I put it that way only for display purpose.

How To Use:

mp4-mobile.sh videofile resultfile

Example:

$ mp4-mobile.sh whatever.flv resultvideo.mp4

The example told the script to convert video from whatever.flv (or any other ffmpeg supported format) to resultvideo.mp4 (MP4 Format). I use this script to convert any video for my Samsung GALAXY Spica (Android) Video Player.

You may change the script parameter as you wish i.e. changing to higher resolution, aspect or video and audio quality. But make sure your player is capable to play it!

As you notice, I use experimental (free) AAC audio encoder (considering that libfaac is not free anymore) so that’s why we have to use -strict experimental option.

mp4-dvd.sh

#!/bin/bash
ffmpeg -i "$1" -s 480x320 -aspect 4:3 -r 25 -b 512k -ab 128k -ac 2 -ar 44100 -acodec ac3 -vcodec libxvid "$2"

Note: Make sure to put all ffmpeg syntax above in one line! I put it that way only for display purpose.

How To Use:

mp4-dvd.sh videofile resultfile

Example:

$ mp4-dvd.sh anyvideo.avi dvdvideo.mp4

The example told the script to convert video from anyvideo.avi (or any other ffmpeg supported format) to dvdvideo.mp4 (MP4 DVD Format/DivX Compatible). I use this script to convert any video for my LG DVD/MP4/DivX Player (should work with another DVD/MP4/DivX player too). Just burn all converted files in one DVD and play them on your player.

Again, you may change the script parameter as you wish i.e. changing to higher resolution, aspect or video and audio quality. But don’t change video and audio codec parameter, also make sure your player is capable to play it!

Don’t forget to make all of those script executable and available on system path and of course you should have fully functional FFmpeg on your system.

Synchronize Windows Mobile 6.5 and Linux Box

Synchronize Windows Mobile 6.5 and Linux Box

If you are confuse with many tutorial about how to connect your Windows Mobile 6.5 (WM65) device to your Linux box, then we have a same problem. I’m struggling to solved this problem for three days with googling and testing. And luckily now it works!

My Configuration

Samsung Omnia Pro (GT-B7320), Windows Mobile 6.5, and Fedora 12.

Checklist

  1. Please backup your contacts to free sync service such as Google Sync (highly recommended). After you do the backup, please remove ActiveSync partnership with this service.
  2. Make sure you have installed this packages (or equivalent for your Linux distros): synce-kpm, multisync-gui, sync-hal, synce-sync-engine, libopensync-plugin-evolution2, libopensync-plugin-synce-wm5 (not libopensync-plugin-synce because it’s for older devices) and all dependencies.
  3. If you are using firewall, make sure you allow connection from 169.254.2.0/24 (RNDIS interface default). In iptables, we can do this with: iptables -A INPUT -s 169.254.2.0/24 -j ACCEPT. Wrong firewall configuration may block sync-engine and became a problem for synce-kpm.

synce-kpm (Files and Software)

  1. Connect the device using proper data cable.
  2. Run synce-kpm! At first run, you will be asked about making device’s partnership. Just create a partnership with any name you like, select available field you’d like to synchronize and you’re done!
  3. Make sure your devices detected and you have no problem with synce-kpm.

Evolution Sync (Contacts, Tasks and Calendar)

  1. Run multisync-gui and create a group with two member.
  2. First member using evo2-sync plugin and the second member using synce-opensync-plugin (and magically without to change any configuration).
  3. After all done, just click Refresh and your device will synchronized with Evolution.

opensync.py Patch

I have a problem with synchronizing from my device. I could changed the data (Contacts or Tasks) in my Evolution and synchronized well to my device, but didn’t work in reverse!

The problem is caused by a bug in opensync.py just apply this patch if you have a same problem:

--- opensync.py.orig 2010-05-06 11:39:27.990099056 +0800 +++ opensync.py.new 2010-05-06 11:39:27.968098490 +0800 @@ -163,7 +163,11 @@ class OSyncChange(object): thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, obj = None): - this = _opensync.new_OSyncChange(obj) + # this = _opensync.new_OSyncChange(obj) + if obj: + this = _opensync.new_OSyncChange(obj) + else: + this = _opensync.new_OSyncChange() try: self.this.append(this) except: self.this = this __swig_destroy__ = _opensync.delete_OSyncChange

Happy synchronizing!