the force that pushes object up
Random header image... Refresh for more!

Category — Technology

Uninstalling MySQL on Mac OS X Snow Leopard

To uninstall MySQL and completely remove it (including all databases) from your Mac do the following:

  • Use mysqldump to backup your databases to text files!
  • Stop the database server
  • sudo rm /usr/local/mysql
  • sudo rm -rf /usr/local/mysql*
  • sudo rm -rf /Library/StartupItems/MySQLCOM
  • sudo rm -rf /Library/PreferencePanes/My*
  • edit /etc/hostconfig and remove the line MYSQLCOM=-YES-
  • rm -rf ~/Library/PreferencePanes/My*
  • sudo rm -rf /Library/Receipts/mysql*
  • sudo rm -rf /Library/Receipts/MySQL*

The last two lines are particularly important as otherwise, you can’t install an older version of MySQL even though you think that you’ve completely deleted the newer version!

Via akrabat.com.

August 10, 2010   No Comments

Introduction To CouchApps

A CouchApp is just a JavaScript and HTML5 app that can be served directly to the browser from CouchDB, without any other software in the stack.

Read “What the HTTP is CouchApp?” to know more about CouchApps.

August 3, 2010   No Comments

WSO2 Stratos – WSO2 Carbon Middleware Platform As A Srvice

WSO2 Stratos

What is WSO2 Stratos?

WSO2 Stratos is a complete SOA and developer platform offered as a self-service, multi-tenant, elastic runtime for private and public cloud infrastructures. Basically it’s the one and only open source cloud-native middleware out there in the market.

Stratos is WSO2‘s complete SOA platform(WSO2 Carbon) improved to, run as a service on the Web, deploy on your internal private cloud infrastructure based on Ubuntu Enterprise CloudEucalyptus and (coming soon) vmWare vSphere. It is a complete Platform-as-a-Service for private and public clouds.

What does Stratos gives you?

It gives you an Application Server, Registry, Identity Server, Portal, ESB, Business Activity Monitor and Mashup Server as-a-Service, on top of Infrastrcture-as-a-Service(Amazon EC2, Eucalyptus, vmWare vSphere, Saavis and Joyent play). And these services are completely self-service, elasticly scalable, and granularly metered and monitored.

In near future WSO2 Business Process Server and other middleware applications will also be available in WSO2 Stratos.

Why WSO2 Stratos is special?

  • Stratos is Cloud Native. In practice, this means that when you log into Stratos (go on try it now) you can instantly provision your own domain, together with a set of Stratos services.
    • Elasticity: Stratos manages your underlying cloud infrastructure to seamlessly handle the scalability demands of your application.
    • Multi-tenancy: Departments, developer groups, or projects run fully independently, but share the same middleware platform for maximum resource utilization.
    • Billing and Metering: Each tenant can meter their actual resource use for internal billing purposes.
    • Self Provisioning: Authorized users can provision new tenants from a web portal in moments.
    • Dynamic Discovery: Linking up services that reside in a dynamic and elastic environment can be tricky – but Stratos simplifies and automates this process with standards-based service discovery and automatic configuration capabilities.
    • Incremental Testing: Cloud fundamentally changes the way you test and deploy applications, but doesn’t reduce your quality requirements! Stratos allows you to deploy service versions side by side and carefully dial up the traffic sent to each version.
  • Stratos is a PaaS, which you can use in the public web, on a virtual private cloud, or on you own hardware
  • Most currently available PaaS are there to build web applications. But WSO2 offers a complete enterprise architecture – governance, business processes, integration, portal, identity and mashups.
  • Common Enterprise Programming Model (not just Java, WebApp, JAX-WS, but also BPEL, XSLT, XPath, Google Gadgets, WSDL, etc)
  • No vendor lock-in
    • No code lock-in: we use standards-based coding (WAR, JAX-WS, POJO) and Stratos is 100% Apache License Open Source.
    • No model lock-in: we use standards-based services:
      • Identity is based on OpenID, OAuth, XACML, WS-Trust
      • Registry is based on AtomPub and REST
      • Business Process is based on BPEL, etc
    • No hosting lock-in: you can take you apps and data from our public PaaS and re-deploy internally or on your own virtual private cloud anytime you like.

How to get started with WSO2 Stratos?

You have two options to feel the excitement of cloud-native enterprise middleware solution.

Go directly to hosted WSO2 Stratos

Download WSO2 Stratos

Related resources

June 2, 2010   No Comments

Cloud-Native Middleware

Yes, we can deploy our existing middleware on cloud. When we want to handle heavy loads, we can cluster several instances of our middleware and run those instances on several cloud virtual machine instances. But when load goes down at off-peak hours, can we easily scale down our cluster deployed on the cloud.  Can we have multiple isolated tenants within the system deployed on the cloud.

To facilitate requirements like above, our middleware must be cloud-native. But, how can we know middleware tools out there are cloud-native. WSO2 CTO, Paul Fremantle, recently composed a blog post containing core attributes that each cloud-native middleware must possess. Following are the core attributes of cloud-native middleware according to Paul.

  • Distributed / dynamically wired
  • Elastic
  • Multi-tenant
  • Self-service
  • Granularly metered and billed
  • Incrementally deployed and tested

In addition to above attributes, I think that cloud-native middleware or any other application must have the capability to use existing services provided by different cloud vendors and cloud-native middleware must be cross-cloud compatible.

But , it’s a hard thing for vendors, when it comes to cross-cloud compatibility and utilize the existing cloud services. The best solution for this is to come up with a standards for services provided by cloud infrastructures. But, standardizing cloud services will not going to happen near future, because of the current competition and nature of different cloud infrastructures.

At WSO2, our team is working hard to build the cloud-native SOA platform. So be prepared to experience the cloud-native middleware platform.

May 28, 2010   No Comments

Webinar on Hybrid Cloud

The hybrid cloud option leverages the security of a private cloud solution and the elasticity/scalability of a public cloud. Architects designing hybrid cloud solutions need to reconcile between these competing goals. With WSO2’s Cloud Services Gateway organizations can now effectively mediate between their public and private clouds without compromising existing network firewall infrastructures.

Through this webinar you will be able to gain knowledge on WSO2 Cloud Service Gateway, it’s architecture and how to use it on real world environments.

For more information on this webinar please visit ‘Webinar: Makin the hybrid cloud a reality‘.

April 27, 2010   No Comments

Merging PDF Files In Linux Using PyPDF

PyPDF is a handy and valuable Python library for merging and splitting PDF files in Linux. It’s pure Python library built as a PDF toolkit. It is capable of:

  • extracting document information (title, author, …),
  • splitting documents page by page,
  • merging documents page by page,
  • cropping pages,
  • merging multiple pages into a single page,
  • encrypting and decrypting PDF files.

PyPDF is a great Python library use by many Python applications which handles PDF files directly. PDF-Shuffler is a one of the tools written based on PyPDF which you can use to merge PDF files easily in Linux. In Ubuntu you can install it using following command.

sudo apt-get install pdfshuffler

Here is a sample code that merge PDF files together using PyPDF library. In this code I have used PdfFileWriter and PdfFileReader classes from PyPDF module to read and append PDF files together. This sample doesn’t contain completed error handling logic for file handling.

# Copyright (C) 2010 Milinda Pathirage

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import sys
from pyPdf import PdfFileWriter, PdfFileReader

def mergePDFFiles(outputFile, filesToBeMerged):
    output = PdfFileWriter()
   
    if(len(filesToBeMerged) == 0):
        print 'Empty Input File List'
        return;
   
    for inFile in filesToBeMerged:
        print 'Adding file' + inFile + ' to the out put'
        # Read the input PDF file
        input = PdfFileReader(file(inFile, "rb"))
        # Add every page in input PDF file to output
        for page in input.pages:
            output.addPage(page)
    print 'Writing the final out put to file system'
    # Out put stream for output file        
    outputStream = file(outputFile, "wb")
    output.write(outputStream)
    outputStream.close()
   

if __name__ == '__main__':
    i = 0
    outputFile = ''
    inputFiles = []
    for arg in sys.argv:
        i = i + 1
       
        # Getting out file
        if arg == '-o':
            outputFile = sys.argv[i]
            print 'Output File: ' + outputFile
           
        # Extracting Input files
        if arg == '-i':
            outfileOptionPos = sys.argv.index('-o')
            if i < outfileOptionPos:
                inputFiles = sys.argv[i: outfileOptionPos]
                filesStr = ",".join(inputFiles).replace(",", " ")
                print 'Input Files: ' + filesStr
            else:    
                inputFiles = sys.argv[i:]
                filesStr = ",".join(inputFiles).replace(",", " ")
                print 'Input Files: ' + filesStr
               
    # Merging PDF files
    print 'Merging PDF Files......'            
    mergePDFFiles(outputFile, inputFiles)

You can get more understanding about usages of PyPDF if you explore more about open source projects which uses PyPDF. Here are some of the projects which use PyPDF.

Related Resources:

January 16, 2010   1 Comment

Install Adobe Air 2 On Ubuntu 9.10 64-bit

Adobe AIR is a cross-operating system runtime that lets developers combine HTML, Ajax, Adobe Flash, and Adobe Flex technologies to deploy rich Internet applications (RIAs) on the desktop. The most recent version is Adobe Air 2 with more features than ever for the users as well as developers.

AIR 2 builds on the success of AIR 1 by giving developers new capabilities, and even tighter integration with the desktop. Some new features of AIR 2 include:

  • Support for the detection of mass storage devices.
  • Advanced networking capabilities like secure sockets, UDP support, and the ability to listen on sockets.
  • Support for native code integration.
  • The ability to open a file with its default application.
  • Multi-touch and gesture support.
  • New APIs for access to raw microphone data.
  • Webkit update with HTML5/CSS3 support.
  • Global error handling.
  • Improved cross-platform printing
  • Improved security and support for enterprise and government standards.

The beta release of Adobe Air 2 is available for download from Adobe site. But the problem is they don’t provide us with a 64-bit Linux version(for Ubuntu 9.10 64-bit). But there are some workarounds to this problem. You can install 32-bit version in 64-bit Ubuntu by installing some 32-bit libraries.

First, install ‘getlibs‘ tool from http://frozenfox.freehostia.com/cappy/getlibs-all.deb. Then install ‘libhal-storage.so.1′ library using following command.

sudo getlibs -l libhal-storage.so.1

After the above step please download the Adobe Air 2 beta version’s Linux *.bin file from Adobe, and install it by making it a executable and run the bin file in command line.

If every things went well, now you have Adobe Air 2 beta installed on your system. Please restart your browsers and try to navigate to some Adobe Air application sites and install your favorite Air applications from them.

Please note that I have ‘ia32-libs‘ installed in my Ubuntu 9.10 previously. If you have any problem running Adobe Air using above two steps, try to install the ‘ia32-libs’ using Ubuntu package manager. Also refer this knowledge base article from Adobe on installing Adobe Air 1.5 in 64-bit Linux including Ubuntu.

For more information Adobe Air 2:

December 24, 2009   No Comments

Linux Utilities You Should Know About

Utility applications in Linux which are(most of them) originally created for Unix and ported to Linux can be used to make every Linux users life easier. It doesn’t matter whether you are a beginner or a hard core Linux geek, if you know the tools it’ll save you lot of time.

In this post I am going to give you introduction to several utilities available on Linux that originated from Unix based on the recent posts by Peteris Krumins. I am planning to update this post time to time once he add new articles about more tools.

Pipe Viewer

Pipe viewer (Written by Andrew Wood) or pv in short can be used inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion.

Default Ubuntu installation doesn’t come with this tool. You need to install it using ‘sudo apt-get install pv’ command.

To get start with pv, lets use this to monitor the progress of compressing large file containing giga bytes of information in to a small file. The normal way to do this using gzip is like following.

gzip -c x.avi &gt; x.avi.gz

But this command won’t tell you how much time it takes to compress this file or monitor the progress of compression.

By using pv you can precisely time how long it will take. Take a look at doing the same through pv:

pv x.avi | gzip &gt; x.avi.gz

69MB 0:00:04 [  15MB/s] [==================&gt;         ]   74%  ETA 0:00:01

Pipe viewer acts as “cat” here, except it also adds a progress bar. We can see that gzip processed 69MB of data in 4 seconds. It has processed 74% of all data and it will take 1 more seconds to finish.

There are several advance usage patterns of pv command and I am not going to cover those.Please refer the article from Peteris to explore more about pv command.

lsof(list open files)

Peteris called this tools as the Swiss Army Knife of Unix Debugging. lsof is a utility command that you can used to list information about files opened by  Unix/Linux processes. In Unix/Linux every things is a file: pipes are files, IP sockets are files, unix sockets are files, directories are files, devices are files, inodes are files… So you know the advantage of this kind of tools where every thing is a file.

Using lsof

Here are some common uage scenarios of lsof comand extracted from catonmat.net blog. You must have root permission to get the information about all the open files using lsof. Unless otherwise you’ll only get information set of files which you have permission to access them.

List all open files

Running lsof without any arguments lists all open files by all processes.

# lsof

Find who’s using a file

With an argument of a path to a file, lsof lists all the processes, which are using the file in some way.

# lsof /path/to/file

You may also specify several files, which lists all the processes, which are using all the files:

# lsof /path/to/file1 /path/to/file2

Find all open files in a directory recursively

With the 

+D

argument lsof finds all files in the specified directory and all the subdirectories.

# lsof +D /usr/lib

There more use cases of lsof command like getting open files by process, open files by users, list all network connections, list all TCP connections, list network activity by user and etc. Please refer blog post from Peteris for those usage scenarios. You can find some examples of lsof from this link also.

December 24, 2009   No Comments

The Complete Middleware Platform for Heterogeneous SOAs

SOA is not only about service hosting(implementing Web Services that expose certain business functionality over network). It’s about enhancing efficiency, agility and productivity of an enterprise by applying service oriented design paradigm and service oriented architecture concepts to when implementing information systems which are critical to business functionality of enterprises.
<img style=”vertical-align: middle;” title=”Requirements of a Complete SOA Platform” src=”http://blog.mpathirage.com/wp-content/uploads/2009/12/platform1.png” alt=”" width=”490″ height=”324″ />
<p style=”text-align: center;”></p>
So when it comes to implementing SOAs, there is a need for several technologies, products, APIs, supporting infrastructure and various other parts. In a typical SOA implementation at least there will be a service hosting environment, an ESB, a service governance tool, a business process management system, a portal server and set of monitoring tool which used to monitor the whole system real-time for fine tuning business processes, service APIs and etc.. There are lot of tools and products available which provide the above mentioned functionalities. Some provide set of functionalities and some has several products that provides most of the functionalities separately. The problems with those existing products and platforms are they are not very well fit together even though they are from same vendor or most of the time those platforms are heavy weight and required lot of time to getting started with them and getting familiar with the tools.
For a long time IT departments heavily suffered from drawbacks of the available products. The cost, complexity, time need to getting familiar with the products and the maintenance issues became a real pain to the enterprises use these products.
With the recent announcements on availability of <a href=”http://wso2.com/about/news/wso2-debuts-wso2-gadget-server-portal-platform-for-creating-personalized-soa-dashboards/” target=”_blank”>WSO2 Gadget Server</a> and <a href=”http://wso2.com/about/news/wso2-launches-wso2-business-activity-monitoring/” target=”_blank”>WSO2 Business Activity Monitor</a>, WSO2 SOA Platform has become the <a href=”http://wso2.com/about/news/wso2-delivers-first-complete-middleware-platform-architected-specifically-for-heterogeneous-soas/” target=”_blank”>most complete and comprehensive open source SOA platform</a> which provides all the functionalities required to full fill SOA implementors requirements while keeping it’s simplicity intact. I can assure you that it is the most light weight, high performance, extensible and most user friendly SOA platform out there.

SOA is not only about service hosting(implementing Web Services that expose certain business functionality over network). It’s about enhancing efficiency, agility and productivity of an enterprise by applying service oriented design paradigm and service oriented architecture concepts to when implementing information systems which are critical to business functionality of enterprises.

SOA – Enterprise Expectations

So when it comes to implementing SOAs, there is a need for several technologies, products, APIs, supporting infrastructure and various other parts. In a typical SOA implementation at least there will be a service hosting environment, an ESB, a service governance tool, a business process management system, a portal server and set of monitoring tool which used to monitor the whole system real-time for fine tuning business processes, service APIs and etc.. There are lot of tools and products available which provide the above mentioned functionalities. Some provide set of functionalities and some has several products that provides most of the functionalities separately. The problems with those existing products and platforms are they are not very well fit together even though they are from same vendor or most of the time those platforms are heavy weight and required lot of time to getting started with them and getting familiar with the tools.

For a long time IT departments heavily suffered from drawbacks of the available products. The cost, complexity, time need to getting familiar with the products and the maintenance issues became a real pain to the enterprises use these products.

With the recent announcements on availability of WSO2 Gadget Server and WSO2 Business Activity Monitor, WSO2 SOA Platform has become the most complete and comprehensive open source SOA platform which provides all the functionalities required to full fill SOA implementors requirements while keeping it’s simplicity intact.

SOA – WSO2 Platform - Today

I can assure you that it is the most light weight, high performance, extensible and most user friendly SOA platform out there. Because of the power of OSGi based WSO2 Carbon platform, we were able to build unified, consistent and fully componentized SOA platform out there in the market.

If you want to know how WSO2 come here to the state where we are now, read the recent blog post from Samisa, director of engineering WSO2. Also this not the end, this is only the start of becoming world’s best SOA platform provider.

December 17, 2009   No Comments

How To Disable Dynamic Frequency Scaling(CPU Throttling) In Ubuntu Jaunty(9.04)

The management of energy consumption in laptops and other mobile devices is increasingly important in order to extend the battery lifetime or to increase the number of applications that can use the system’s resources. It is also used in quiet computing settings and to decrease energy and cooling costs for lightly loaded machines.

Even though this technology has many advantages when using laptop with battery power, it makes me annoying sometimes when I work using AC power.In some situation it makes my laptop very slow when I run several applications like Firefox, IntelliJ IDEA and Adobe Acrobat simultaneously. I have to always switch frequency scaling to performance to get required level of responsiveness and sometimes my Ubuntu 9.04 failed to scale the frequency when I want it to do it. Because I have AC power most of the times I decided to switch to performance mode permanently.

As I found out, sudo dpkg-reconfigure gnome-applets method does not work anymore and instead I have to install rcconf and configure CPU throttling using rcconf.

First we need to install rcconf using sudo apt-get install rcconf command and then run it with administrative privileges using sudo rcconf . You will following configuration view on you terminal. Then search for ‘ondemand‘ option and disable(un-check the check-box) it using space-bar. To save the configuration hit the tab key so that “OK” is highlighted then enter to save and reboot.

rcconf

Now from the add CPU Frequency Scaling Monitor applet to your Gnome panel and select ‘Performance’ option by clicking applet.

How to revert the change

Open the rcconf application again with administrative privileges and scroll to bottom. There will be un-checked ‘ondemand’ option, check it using space-bar and save. The change will be available from the next restart.

October 4, 2009   2 Comments