Mobil Mewah

Salah satu sumber Inspirasi.

Mobil Sport terbaik

Anda pasti bisa memilikinya.

Bermain dengan pesawat

Salah satu ide yang gila, Balapan di udara.

Bermain di angkasa

Apakah ini salah satu Goals dalam hidup anda? anda pasti bisa mencapainya

Tuesday, 2 December 2014

Lightweight Battery Monitoring in Debian

I use Fluxbox in my desktop laptop with Debian 7 OS. I need a battery status monitor which is easy to spot the battery status.

So i found this small application, xbattbar which can monitor battery status via acpi which many laptop support nowdays.

Just install and run it with the startup of the fluxbox.

To run it call the application with :

$xbattbar

To run with acpi :

$xbattbar -c

Here are some preview of my desktop. The green bar below is the battery status.

Xbattbar Status in desktop



Friday, 14 November 2014

Centralized vs Decentralized application portfolio strategy

In managing IT startegy, especially Application portfolio, there are 2 management style which are Centralized and Decentralized in decision making. And for better understanding deeper about the 2 style, there are 4 type matrix for the strategy in detailed view using below matrix.

Source: John Ward and Joe Peppard, Strategic Planning for Information System p.336


Tuesday, 11 November 2014

Highlight text in PDF

We all use pdf, because many documents also use pdf for their publishing formats. Even ebooks come with pdf, and sometimes when reading it, we need to jot down notes on it or highlight it as we used to with a books.

So with pdf, we can do highlight the important one, and even the original pdf still intanct. Here come the application that can do this. Xournal is a pdf highlight application, which create a new file to overlay the highlight of pdf. Even you can create your own version of pdf which already been highlihted.


PDF Highlight
Xournal run in Unix BSD, Linux, MacOS , and Windows with source code.

Visit their website xournal

Happy Highlight in PDF.

Saturday, 8 November 2014

IT Cost by Critical Success Factor perspective

In measuring IT cost, we can also use Critical success factor (CSF). This can be use to measure the startegic performance through IT which relate the CSF with the IT cost needed.

With this CSF, organization will have specific target and measurement within IT strategic investment decision.

IT Cost by Critical Success Factor matrix

IT Balance Scorecard perspective

When relate IT to cost, IT always relate to High Cost, especially in initial stage. We need to measure the value of the IT investment made by company related to company performance and metrics, especially understandable by business people.

We are IT people talk about technical performance, and Business people understand about money, reveneu, profit, and other financial measure. So there is gap between IT and business.

Coma the Balance Scorecard which can be use to communicate the IT value provided to business and relate its output with company financial performance like cost Vs revenue  in a balance sheet.

Balance scorecard have 4 perspective in the creation so the balance perspective provided within the scorecard. This is usefull to get a balance perspective with IT or non IT performance measurement.

4 basic question from many perspective in Balance Scorecard :


  1. How do customers see us? (Customers perspective)
  2. What must we excel at? (Internal perspective)
  3. Can we continue to improve and add value? (Innovation and learning perspective)
  4. How do we look to shareholders? (Financial perspective)


Balance Scorecard Perspective


Some example here is provided which relating IT cost with Financial performance indicator :

Relating Cost to the Balance Socreboard of an airline Example

Saturday, 25 October 2014

Django optimizing Memcache and Nginx

I have a django application which complete and ready to deploy. One of the requirement are :


  • It will run 24x7 with minimum interupption
  • Down Time will be only 3 hours every monday
  • User will access concurrently around 17 users

So with this requirement, i want to have my django app high performance without glitch and fast. What already implemented in code are using some method which are :

  • Using Postgresql Database in a separate machine.
  • Using memcached to do caching
  • Using django-compressor to compress static files
  • Using Nginx web server to server static files
  • using Gunicorn to server the Django application
So that all basic optimization for Django application or Web based application. The application is a simple single table query and an insert to database.

So the application will have insert to table when external user hit the web apps. Then the client will have pool the server for the input every 2 seconds. so the access will be all the time.

So I put some testing of the performance. First using single machine hosting a memcache and postgresql. The setup are :
  • Cache using memcache localy
  • Session using Memcache
  • Nginx server static files
 and here are the results :

Test 1 with single machine setup

Then i try other setup, which difference are put session in postgresql and here the results :

Test 2 Django session using Postgresql

And then last one, i setup a load balanced setup with 2 django app server, here are the setup :

  • Memcached setup as shared memcache between 2 Django app
  • Nginx as a single entry load balance the application request to 2 Django app server
  • Postgresql is still separated machine.
  • Django Compressor is still used.
And here are the result of the test :

Django app load balanced with Nginx in front of application

As you see, the result is better if we horizontal scale the python serving django applications. The load balance in Nginx is a standard setup with 2 upstream point to django app server.

Even the Nginx server still hosting 1 django app, and other machine hosting only django app,with memcache in each server as shared memcache pool, and the postgresql is a single machine.

The improvement is huge. From 40 Req/sec to 117 Req/sec , 2x improvements. This still not optimize the database cache, as i using Django 1.6 and johny cache still not available at this time to be use with Django 1.6

On problem to be note, the django-compressor got problem when setup as multiple python app server, because the key to generate key cache prefix is using the host name, so in one another of the server, there will be missing static compressed file. So we just generate the compressed static in 1 machine, and copied to the other machine and this solved.





Monday, 6 October 2014

PDF generation in Django Apps

One of the beautiful thing when using Django is the rich set of application ready to use as a plugin in your project. Is it use at is or modify/extend with a little effort.

One of my project need to generate a PDF and the time is come to get some Django PDF application plugin. So Django documentation officially told to use reportlab. I try the reportlab, but got error with first try from the code in Django documentation stated here.

Then look further, i found pisa is very neat to generate a PDF for you with a common Django way. How does pisa do the job? Well it still need reportlab, and html5lib , and it just convert your HTML output into pdf output using your django view.

So we already have the html output in Django app, then just feed it to pisa, and the pdf will generated.
You can download pisa3.0.33 in here .

But also notice that pisa3.0.33 is got problem which cause it cannot run with reportlab>3.0 .

To fix it go to the installation of pisa , and find sx/pisa3/pisa_util.py :

if not (reportlab.Version[0] == "2" and reportlab.Version[2] >= "1"):

   raise ImportError("Reportlab Version 2.1+ is needed!")

REPORTLAB22 = (reportlab.Version[0] == "2" and reportlab.Version[2] >= "2")
This will make pisa fail when the import processed by python. To resolve this replace it with this code :
if not (reportlab.Version[:3]>="2.1"):

    raise ImportError("Reportlab Version 2.1+ is needed!")

REPORTLAB22 = (reportlab.Version[:3]>="2.1")

Then that's it, your pisa will work with Django.

The next post , i will give the code to generate the pdf with pisa in django.

Cheers

Twitter Delicious Facebook Digg Stumbleupon Favorites More