ource ...rch 2013

Page 1




Contents DEVELOPERS

30 Develop Android Apps with Ease

32 A Few Things You Should Know About Futexes

35

Planning an Android-Based Device for an Enterprise

40 Have You Powered Your Application with Memcached?

51 Programming Socket in C (TCP) 54 Try Your Hand at the Dropbox API for Android

57 Introducing Celery for Python+Django

45 Build Your Own Web Page With QForms

admin 61 Going Virtual With OpenVZ 65 Ensuring Security on

Open Source Virtual Platforms

67 72

A Look at the Basics of LVM Deploying a Ticket Request System with OTRS

74 Kick-Starting

Virtualisation with VirtualBox

100

For SMBs, Virtualisation is the Way to Go!

Source Access to MS Exchange 78 Open Server Using DavMail Reco mm end ed

rep lac em af ree for

to us a t sup port @e fyin dia .co m work properly, write

s not DVD doe is se th In ca

A free, easy to use Linux-based operating system for desktops and laptops

e Driv OM D-R DV

LIVE DVD

Also includes ISOs of Snowlinux, Archlinux and Zorin OS CD Team

e-mail: cdteam@efyin dia.co m

4  |  march 2013 | OPEN SOURCE FOR YOU

Re qu ire me nt

M, RA GB

PClinux OS

Sys tem

,1 P4 s:

ON THE DVD

e

. nt




Trained participants from over 42 Countries in 6 Continents Linux OS Administration & Security Courses for Migration LLC102: Linux Desktop Essentials LLC033: Linux Essentials for Programmers & Administrators LLC103: Linux System & Network Administration LLC203: Linux Advanced Administration LLC303: Linux System & Network Monitoring Tools LLC403: Qmail Server Administration LLC404: Postfix Server Administration LLC405: Linux Firewall Solutions LLC406: OpenLDAP Server Administration LLC408: Samba Server Administration LLC409: DNS Administration LLC410: Nagios - System & Network Monitoring Software LLC412: Apache & Secure Web Server Administration LLC414: Web Proxy Solutions Courses for Developers LLC104: Linux Internals & Programming Essentials LLC106: Device Driver Programming on Linux LLC108: Bash Shell Scripting Essentials LLC109: CVS on Linux LLC204: MySQL on Linux LLC205: Programming with PHP LLC206: Programming with Perl LLC207: Programming with Python LLC208: PostgreSQL on Linux LLC504: Linux on Embedded Systems LLC702: Android Application Development RHCE Certification Training RH124: Red Hat System Administration - I RH134: Red Hat System Administration - II RH254: Red Hat System Administration - III RH299: RHCE Rapid Track Course RHCVA / RHCSS / RHCDS / RHCA Certification Training RHS333: Red Hat Enterprise Security: Network Services RH423: Red Hat Enterprise Directory Services & Authentication RH401: Red Hat Enterprise Deployment & Systems Management RH436: Red Hat Enterprise Clustering & Storage Management RH442: Red Hat Enterprise System Monitoring & Performance Tuning RHS429: Red Hat Enterprise SELinux Policy Administration RH318: Red Hat Enterprise Virtualization NCLA / NCLP Certification Training Course 3101: SUSE Linux Enterprise 11 Fundamentals Course 3102: SUSE Linux Enterprise 11 Administration Course 3103: SUSE Linux Enterprise Server 11 Advanced Administration

Advanced Administration Training on DNS, Samba, Nagios & Postfix DNS Server Administration: 9 Mar 2013 Linux System & Network Monitory Tools: 23 Mar 2013 Apache Server Administration: 16 Mar 2013

RHCVA / RHCSS / RHCA Training - Exams RH318: 9, & 23 Mar 2013; EX318: 19 April 2013; RHS333: 15 Mar; EX333: 8 Mar; RH423:16 Mar; RHS429: Call; RH401: 6 May, EX401:10 May; RH436: 13 May; EX436: 17 May RH442: 20 May; EX442: 24 May

RH299 from 4, 11, 18, 25 March EX200/300 Exam 15, 22, 29 March LLC - Authorised Novell Practicum Testing Centre NCLP Training on Courses 3101, 3102 & 3103

CompTIA Storage+ & Cloud+ Training & Certification from March ‘13 Microsoft Training Co-venture: CertAspire Microsoft Certified Learning Partner

www.certaspire.com For more info log on to:

www.linuxlearningcentre.com Call: 9845057731 / 9449857731 Email: info@linuxlearningcentre.com

RHCSA, RHCE, RHCVA, RHCSS, RHCDS & RHCA Authorised Training & Exam Centre

Registered Office: # 635, 6th Main Road, Hanumanthnagar, Bangalore 560019

# 2, 1st E Cross, 20th Main Road, BTM 1st Stage, Bangalore 560029. Tel: +91.80.22428538, 26780762, 65680048 Mobile: 9845057731, 9449857731, 9343780054

Gold

Practicum

TRAINING PARTNER

TESTING PARTNER


YOU SAID IT Include more content on Raspberry Pi I have been a long-time subscriber of your magazine—in fact, right from Issue 1. I came to know of Raspberry Pi through this magazine and recently got one. I was expecting some more articles on it in OSFY but have been disappointed. However, I was happy to see links to tutorials in your website. I am sure this tiny computer is going to bring a lot of cheer to the student and hacker community so I hope that at least two pages in your magazine will get devoted to Raspberry Pi. The lack of VGA is a big concern in Raspberry Pi. The composite video's resolution is very poor in our old Sansui HDMI LCD monitor and I was not getting a HDMI output. Meanwhile, I wanted to try networking in Ra Pi. So, I connected it with a Compaq laptop through a router. The laptop has a Tata Docomo 3G dongle for Internet access. When this Net connectivity is shared, it got the IP address as 192.168.0.1. I then gave static IP to Ra Pi as 192.168.0.2 and the connectivity was established. After suitable entries were made, I found that Raspberry Pi got connected to the Net. Of course, it was all possible due to Google as well as Raspberrypi.org. Again, tweaking the entries in text files was difficult. So, through PuTTy, I logged into Ra Pi and could easily modify the text entries. The file - /boot/config.txt - is very important and I am at present studying various combinations for HDMI. I am sure such information written professionally will be of great help to the Ra Pi community. Years back, I had a Spectrum computer, which is spoken of highly even now. There were so many magazines and books (that still adorn my bookshelf) on the Spectrum that it was a pleasure to leaf through them. Perhaps, some magazine on Raspberry Pi will come out some day but till then, I am sure OSFY can come forward to do the needful. —V.S. Nagasayanam, vsayanam@gmail.com ED: Thanks a lot for sharing your feedback with us. It makes us feel good that we have been able to motivate you to acquire a Raspberry Pi for yourself. We have featured a few articles on Raspberry Pi in OSFY. (‘Getting Started with Raspberry Pi’ in November 2012 and ‘Control Raspberry Pi’s GPIO Pins with PHP’ in December 2012.) We are also planning to start a series on it and you will get to read these articles in the upcoming editions. The OSFY team is constantly trying its best to come out with varied articles related to open source and will continue to do so, always. Keep writing in with your suggestions; we welcome them. 8  |  March 2013 | OPEN SOURCE FOR YOU

Changing the colour of the code snippets I am a regular reader of OSFY. I have a suggestion. Currently, the source code snippets are printed in light blue. On a white paper, the text printed in light blue is indeed difficult to read. I would appreciate it if you make the colour of the code a darker shade of blue. —Ganesh Sanjiv Naik, ganesh@levanatech.com ED: Thanks a lot for bringing this issue to our notice. We certainly agree with you that the colour of the code needs to be changed for better readability. We have changed the colour of the code and increased its font size too. Hope we have been able to help you.

On becoming a member of the FOSS community I’m an assistant professor in a reputed engineering college in the northern part of Karnataka. My colleagues, my students and I want to become members of the FOSS community, so that we can get regular updates about the latest happenings in this arena. I would be grateful to you if you let me know on how we could do so. This will help me in inviting good speakers to deliver lectures on the latest trends in open source technology at my college. —Manju Shirur, manju_shirur@yahoo.co.in ED: Thanks for reaching out to us. We are indeed glad to know that you want to be a part of the FOSS community. To learn more about the latest happenings in the open source arena, you can: 1. Subscribe to Open Source For You at http://electronicsforu. com/electronicsforu/subscription/subsc2scheme.asp#. 2. Subscribe to the mailing list of Indian Linux Users Group (ILUG) where you can interact with experts who have immense knowledge in this domain. ILUG Chennai is quite active in southern India. Here is the link: http://ilugc.in/mailing-list/ 3. You can be a part of different events related to open source such as Open Source India, which is held in Bengaluru every year. For more details, check out http://www.osidays.com/. Hope this helps. Let us know if you have any further queries.

ClearOS CD missing from the February issue I received my subscriber’s copy of OSFY a few days back. And I was disappointed to find that it came only with the Fedora 18 DVD sans the ClearOS CD. Kindly look into this matter. My subscription number is L21591. —Krishnan Kumar, krishankumarjhs@gmail.com



YOU SAID IT ED: The ClearOS CD was only meant for the newsstands and was sold at an additional cost. If you want, we can definitely arrange for you to get a copy. Our support team will help you.

Providing the DVD’s contents for 32-bit users

Mahesh Watkar: I always enjoy reading OSFY and I am a big fan of it. I love to try the DVD and CD contents virtually. But nowadays, it seems you have targeted the DVD and CD contents only for 64-bit users. What about the 32-bit users who don’t have faster Internet to download ISOs from websites? You should provide the 32-bit and 64-bit ISOs in the same DVD so that all Linux fans are served equally.

Subscription without DVD I have been a subscriber of OSFY since the last one year. My subscription number is L22485. Is there an option to subscribe to OSFY without the CD/DVD, at a lower price? If I need one, I can download the latest distro. The magazine’s content is very useful and of great help. —Babanna S Duggani, babanna.duggani@gmail.com

Linux For You: Hi Mahesh! We are

ED: Thanks for the letter. Currently, we do not offer such an option for the print edition of our magazine. We have noted your views and will try to work out something. But if you do not want the DVD, we have an e-zine that allows you to enjoy the digital version of the magazine. For OSFY subscribers, the e-zine service is free. Log on to http://ezines.efyindia.com/ for details.

indeed happy that you have noticed this problem. We have provided the Ubuntu DVD (in our November 12 edition) for 32-bit users. But yes, we have noted your suggestion and will try our best to incorporate it in our future editions.

Increase in price of OSFY

Samaresh Biswal: I have been following

Help from the community

your magazine from a long time and your mega 10th anniversary issue on 'Top 10 of everything on open source' was indeed interesting and informative. Just wanted to know why the price of the magazine has been increased to Rs 125?

Jeykrishnan Janardhanan: Hi OSFY!! How

do I connect the Net to my laptop (Asus) from my mobile (Samsung Galaxy Ace)? I have GPRS connectivity and have also installed Kies!!

Linux For You: Hi Samaresh! We are glad

Linux For You: Hi Jeykrishnan! It would be great if you post this query on our Facebook wall. You would get varied suggestions from the community, which we are sure will help.

to know that you liked the February issue. The price for this issue was increased because we had enclosed an additional CD—the ClearOS CD – in the copy that was sold on the news stands. But the increase in price was just for this issue. The price of the magazine remains Rs 100.

Jeykrishnan Janardhanan: Thanks

a lot! I did that and got interesting answers from the community. It was indeed helpful.

Loved reading E-Preneur Venture

Murali Krishnan: The article ‘Starting our own E-Preneur Venture Using Open Source Tools’, published in the January issue, is indeed informative and insightful. Would love to see more articles like this in OSFY. Linux For You: Thanks a lot for the

compliment. We will convey your feedback to our author Uday Mittal, and definitely try to incorporate more such articles in future editions.

10  |  March 2013 | OPEN SOURCE FOR YOU

Please send your comments or suggestions to:

The Editor D-87/1, Okhla Industrial Area, Phase I, New Delhi 110020 Phone: 011-26810601/02/03, Fax: 011-26817563 Email: osfyedit@efyindia.com


Admin

Insight

For SMBs, Virtualisation is the Way to Go! The virtualisation market has gradually matured over the past few years, with most enterprises adopting it today. And now, SMBs too are switching to it, on a large scale.

V

irtualisation has become almost mandatory for all companies deploying IT solutions in any way. It simplifies one’s IT infrastructure, creating a more dynamic and flexible set-up. As B S Nagarajan, director, System Engineering, VMware India & SAARC, rightly puts it, “Virtualisation makes your IT infrastructure simpler and more efficient. With virtualisation solutions, applications get deployed faster, performance and availability soar, and operations become automated, resulting in IT that’s easier and less costly to own and manage.”

100  |  March 2013 | OPEN SOURCE FOR YOU

Needless to say, virtualisation is currently the norm for modern-day IT infrastructure. Kashish Karnick, brand manager, IBM BladeCenter, India and South Asia, says, “Virtualisation is changing the way people work. It allows customers to consolidate their workloads on to a fewer number of hardware systems. It is possibly one of the most important aspects in today’s IT world. It has led to an absolute overhaul of the computing industry. The awareness about virtualisation is growing and people are aware about the advantages it provides.”


Insight The latest trends in virtualisation

Increased percentage of virtualised workloads: One of the trends that the Indian virtualisation industry is witnessing is the increasing workload that customers are virtualising. Nagarajan says, “I have been around in this industry for quite some time now, from the days when we had to literally struggle to make customers aware about the benefits of virtualisation. From such a scenario, we moved to a phase when customers started virtualising a few workloads for test and development; and today, I am glad to share that we have customers who have virtualised all the way from 50 per cent to around 80-90 per cent of their data centres. In fact, there are a few customers who are 99-100 per cent virtualised. The trend we are seeing is that customers are comfortable increasing the percentage of workloads that are virtualised.” Business-critical applications go the virtualisation way: Bhaskar Jayakrishnan, director, Software Development, Computing Systems Product Group, Cisco, talks of the virtualisation trends in the domain of business critical applications. He says, “The other trend that we are observing (which is also the reason behind the emergence of the first trend) is the virtualisation of business critical applications. Gone are the days when customers would virtualise only those applications that are less critical. The companies used to virtualise only the applications that IT was very confident about. They never touched the applications owned by businesses, like ERP and mail messaging. “Some of these applications are extremely critical to organisations and they were not virtualised a few years ago. But now a number of customers are coming forward to virtualise their business critical applications like SAP, Oracle Business Suite, etc. There were never any security-related fears for these applications. Organisations worried about whether the critical application would run the same way on a virtual platform as it did on a physical platform, and whether its performance would suffer. We have addressed most of these concerns now, and there are enough ways to prove that your performance is not going down. You get the same performance and, in some cases, it is even better—if you make the best use of the platform. Most vendors today are virtualisation friendly.” Migration of workloads from UNIX to x86 environments: Arun Kumar, general manager, Red Hat India, says, “India is a UNIX rich country, in the sense that we have a lot of UNIX deployments in India, compared to other countries. These days, we are seeing a number of customers (thanks to the high cost of maintenance, growing complexity, and so on) trying to move away from their legacy UNIX environments to the x86 environment.”

SMBs are getting virtualisation-friendly

Most companies offering virtualisation solutions have

Admin

customised offerings for SMBs. In fact, this is a very important segment for a majority of companies. Nagarajan emphasises, “Virtualisation in the world of SMBs is growing by leaps and bounds. This sector will continue to be our focus area this year as well. Some of our offerings are strictly dedicated to SMBs, and we are constantly trying to make them more affordable. The word SMB implies different things to different companies but for VMware, SMBs are companies that are not necessarily small but whose IT infrastructure may be small or medium—for instance, a large textile firm could have a large business volume, but we might classify it as an SMB from the IT infrastructure point of view. There is a lot of traction amongst the SMBs and SMEs for virtualisation. Let me give you an example. Disaster Recovery (DR) is generally associated with large customers with big data centres. Not many small companies go beyond a certain point when it comes to scaling up their IT infrastructure, as it is expensive and complex. But we all know that IT is critical for any company, whether it is small or big. A lot of small companies were not able to afford the expensive DR solutions previously. So starting this year, we have included the replication part which is used for DR as a free component in our existing licences. As a result, even SMB customers will be able to replicate their data and servers from one location to the other. So this is just one example. “The other important example revolves around backups, which are critical to every customer, be it an SMB or an enterprise. So we have included a back-up solution in our licences, free of cost. This is an issue that every SMB faces. They are not able to afford more expensive back-up software, so a part of the back-up solution is included in our package,” he adds. So the belief that virtualisation is not meant for SMBs and is only for bigger companies is gradually fading away. Karnick adds, “First of all, nobody implements a technology just for the sake of it. People implement technologies to address their business problems. Most customers spend a majority of their time and budget in solving their existing problems, which leaves them with very little time and money to focus on newer innovations that can help them grow. Typically, the function of IT is to keep things moving. Thankfully, due to virtualisation, a lot of these problems are resolved and the IT team is now able to think beyond the regular issues and take a step ahead in the direction of innovation.” By: Diksha P Gupta The author is assistant editor at EFY.

OPEN SOURCE FOR YOU | March 2013  |  101


For U & Me

Case Study

How OSS Helped a Construction Company Almost Halve its IT Budget! SEW Infra has been able to save nearly 40 per cent of its IT budget by deploying open source solutions.

O

pen Source India 2012 attracted a diverse audience. Techies from all parts of the world came to the convention to share and understand the latest in open source technology. But it was Shivaram Yeruva, from the construction industry, who presented a most interesting case study. This IT infra lead of SEW Infrastructure narrated a success story about how open source technology not only helped him cut costs but also win over his colleagues to the OSS cause. SEW Infrastructure Limited (www.sewinfrastructure. com) was founded in 1959, and is currently headquartered at Hyderabad in India. The company is one of the largest civil infrastructure-engineering majors in the country. 102  |  March 2013  |  OPEN SOURCE FOR YOU

The company has several projects across India and Africa

Shivaram Yeruva narrates, “When I joined SEW Infrastructure Ltd in September 2008, the company was in the middle of the Oracle ERP implementation. The initial part of my role was to set up a data centre at the SEW office to host the production class servers. The goal was to enable speed and flexibility in server provisioning while containing the costs. We looked into setting up the entire environment in a virtual environment. Part of the challenge was that Oracle EBS was not yet certified to be hosted on virtual servers. With the support of the management, I risked going for a virtual environment since the application was still under development. We


Case Study looked into several options available in the market, but settled for XEN virtualisation, which is under GPL and is an open source platform. “Over the next few months, the environment not only proved to be absolutely stable but also offered the flexibility required for rapid cloning, backup, server to server migration. The fact that the servers were virtual made no difference to the Oracle EBS application and database admins. We deployed our entire data centre on open source by using XEN virtualisation, iptables as firewall, Snort as the Intrusion Detection System, Squid as the Internet filter/proxy, Nagios as the network and device monitoring system, and Zci and OCS for asset management. “SEW’s construction sites are spread across the length and breadth of the nation, with some of them located in hard to reach places such as Arunachal Pradesh and North Sikkim. Our employees had to trek several kilometres to make a phone call and get in touch with the head office. We set up a nationwide VoIP infrastructure on Asterisk running in the XEN environment that handles more than half a million minutes of voice calls per year.”

The challenges were many

Shivaram’s belief in open source technology drove him to convince more and more colleagues in the industry about its benefits. He reminisces, “While we were discussing our ERP deployment on open source, the management was concerned about the post ‘go-live’ support. The ERP implementation partner recommended against virtualisation since it was not supported by Oracle at that point of time. Since we were still in the ‘development’ mode, we went ahead and took that risk. We were cautioned that it was not a standard procedure or a good practice. Our CIO, Sidhartha Meka, supported us by trusting our technical expertise.” At the end of the day, it appears that what is required is conviction and the technical knowhow. Things fall in place if these two are perfectly aligned. Eventually, when the application was finally ready for production level deployment, Oracle EBS was certified on Oracle’s VM. Today, when he looks back, Shivaram feels good about the fact that he could continue with his passion for open source technology, while benefiting the company. He says, “Being a non-IT company, we always have budget limitations for IT infrastructure – which was yet another reason to implement open source apps, apart from my passion for open source technology. When we went on to search for the appropriate open source software for our company, we found quite a few alternatives. The beauty of open source is that it allows complete flexibility and one can do modifications as

For U & Me

per the requirements. We found it easier to manage after deployment, as we could get immense support from the forums.” However, Shivaram's quest did not end here. He wanted to leverage open source tools to enable the end users as well. He says, “We have deployed Shivaram Yeruva, IT infra lead, many open source software SEW Infrastructure Ltd at the user level, which has helped in reducing our costs to a large extent. Earlier, we used to purchase office tools and PDF tools to convert the documents. But now, we are using OpenOffice and LibreOffice; we have many templates available for the same. We use DIA for flow charts or organisation charts. Gradually, we trained our employees to use Linux as their desktop OS. Initially, it was an uphill task, because they were used to Windows and breaking that mindset does take time. With some investment in training, and identifying and supporting the key change catalysts in the organisation, we are getting good results in the transition from Windows to Linux. After some initial hiccups, things have been smooth.” Shivaram explains that his job as an IT manager is to ensure the organisation’s growth, both technically and financially. Adoption of open source technology definitely required that extra bit of effort, but his conviction to make it was much bigger than the hurdles he faced. He summarizes his experience saying, “Go for open source and try it; later, you'll love the flexibility it offers. Modify it as per your needs and cut your capital expenditure. You will find new information on the forums every now and then that will help you enable innovative solutions. You will not be stuck with a vendor’s development and release cycles, and the frustration of dealing with its support processes for every issue.”

Flexibility, and freedom that is free of cost!

SEW has saved at least Rs 100 million by believing in open source solutions. Typically, provisioning of extra capacity and users requires lengthy budgetary approval processes that hamper business expansion. With open source this is hardly a challenge. Also, the use of open source architectures plants the organisation in an open standards oriented environment. This contrasts with the platformspecific dependencies on the vendors' proprietary technologies that are hard to migrate away from, and also require specialised skills to manage. By: Diksha P Gupta The author is assistant editor at EFY.

OPEN SOURCE FOR YOU  | MARCH 2013  |  103


Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP Parallels IBM

RedHat

Wipro Vmware Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP

A List Of Virtualisation Solutions Providers Cisco Systems | Bengaluru SONA, which includes Cisco Network Virtualisation, encompasses both a vision for the evolution of enterprise IT and a pathway to get there. Cisco differentiates itself from most other vendors by adopting a systems-level approach that integrates services throughout the infrastructure. Looking at the Cisco Catalyst switching portfolio, it becomes apparent that a wide range of Layer 3 switches support network virtualisation. Other vendors have point solutions that are only applicable for limited areas within the campus network. Cisco Network Virtualisation is a primary component of the Cisco SONA framework.

Citrix Systems | Bengaluru The desktop virtualisation system that centralises and delivers desktops to users anywhere, reduces desktop TCO by up to 40 per cent and improves data security by centralising desktop management. XenDesktop delivers a high definition user experience and personalised desktops over any connection.

Dell | Bengaluru

LEADING

The solutions from Dell can help provide a flexible infrastructure for the data centre by providing access to data for remote and mobile workforces using desktop virtualisation solutions. With virtualisation, you can count on an approach that meets your growing needs. It will increase an organisation’s ability to meet evolving business requirements by leveraging existing resources and scaling the infrastructure without the need to rip and replace. Dell focuses on standards-based solutions, keeping the barriers to change low. With Dell, you will not be locked into proprietary hardware implementations or management frameworks that may limit your options in the future.

Hitachi Data Systems | Mumbai Hitachi Virtual Storage Platform is the only 3D scaling storage platform designed for all data types. It is the only enterprise storage architecture that flexibly adapts for performance, capacity and multi-vendor storage. Combined with unique Hitachi Command Suite management software, it transforms the data centre.

HP India | Bengaluru The Client Virtualization Access Service of HP provides multiple network access, flexible role-based access, a userfriendly interface, and a secure printing network—all from a single access device. Using this unique technology as part of a client virtualisation solution, HP can provide a unique user-focused interface to internal, secure, partner, or cloud network resources—all from a variety of endpoint devices—ranging from desktops to tablets.

IBM | Bengaluru IBM Virtualisation provides a logical rather than physical view of data, computing power, storage capacity and other resources. IBM System Storage virtualisation helps provide centralised data management, reduced complexity, and reduced costs. The IBM SmartCloud Virtualized Server Recovery service can help reduce your recovery time and improve the reliability of your recovery infrastructure.

Intel | Bengaluru Hardware-based Intel Virtualization Technology (Intel VT)1 improves the fundamental flexibility and robustness of traditional software-based virtualisation solutions by accelerating key functions of the virtualised platform. This efficiency offers benefits to the IT, embedded developer and intelligent systems communities.

104  | march 2013 | OPEN SOURCE FOR YOU


Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco

Microland | Bengaluru

NetApp Oracle India PVT Ltd Netweb Technologies

Microland’s Desktop Virtualisation Business Value Assessment Service provides a holistic approach towards adopting desktop virtualisation adoption. By using this service, enterprises will understand the state of readiness of existing desktop infrastructure, the impact of desktop virtualisation on the organisation, the business case and ROI for a desktop virtualisation initiative, and obtain a high-level design road map for implementation.

HCL Technologies HP Parallels IBM

RedHat

Wipro Vmware Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland

MontaVista | Bengaluru MontaVista offers several virtualisation solutions, including KVM Hypervisor (full virtualisation), Linux Containers (OS resource virtualisation) and MontaVista Bare Metal Engine (OS resource virtualisation and SoC hardware optimisation).The company’s virtualisation solutions are certified by Linux Standard Base (LSB) 3.0, Carrier Grade Linux specification (CGL 5.0) and SCOPE Alliance Linux Profile 1.1. An impressive level of six nines (99.9999%) in reliability (a downtime of less than 31.5 sec/year) has also been proven by the company.

IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP

Novell India Pvt Ltd | Bengaluru Novell offers a wide range of best-in-breed and robust virtualisation solutions. Some of its key virtualisation solutions include the integrated Xen-based virtualisation solutions built on the capabilities of the SUSE Linux Enterprise Server, Kernel Virtual Machine (KVM), Linux Containers, Hyper-V as well as Windows guest support for KVM.

NetApp | Bengaluru With a NetApp agile data infrastructure, you can run mixed applications in a shared, virtual environment, achieve increased demand and unlimited scalability for your virtual servers, and optimise storage resources for greater efficiency, performance, ROI, and agility. You can also maintain continuous operations during updates, upgrades, and refreshes; and integrate data protection with zero performance impact and faster recovery.

Netweb Technologies | New Delhi Netweb Technologies provides server and desktop virtualisation to its customers. It is also active in the storage solutions and HPC space, and maintains around 5000 servers a year. The firm operates in six cities across India, and has a direct service and sales channel to the end customers.

Oracle India Pvt Ltd | Gurgaon Oracle offers the industry's most complete and integrated virtualisation, from the desktop to the data centre. Going far beyond simple consolidation, the company enables customers to virtualise and manage their full hardware and software stack. Designed for efficiency and optimised for performance, Oracle's server virtualisation products support x86 and SPARC architectures, as well as a variety of workloads such as Linux, Windows and Oracle Solaris.

Parallels | Seattle, USA Parallels uses its open source OpenVZ project as its commercial hosting product for Linux virtual private servers. High density and low cost are the two keywords you'll hear when experiencing a Parallels-based hosting solution. These are the two main reasons why the world's largest hosting companies choose Parallels. But, the innovation doesn't stop at Linux containerised virtual hosting. Parallels has also developed a containerised Windows platform to maximise the number of Windows hosts for a given amount of hardware.

Red Hat | Pune Red Hat Enterprise Virtualization is a complete virtualisation management solution for servers, powered by the people who brought you Red Hat Enterprise Linux. With Red Hat Enterprise Virtualization, you can maintain business continuity, to scale and integrate both Linux and Microsoft Windows workloads. Red Hat Enterprise

oPEN SOURCE FOR YOU | march 2013 | 105


Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP Parallels IBM

RedHat

Wipro Vmware Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP

Virtualization for Servers 3.1 is built on Red Hat Enterprise Linux, a platform trusted by thousands of organisations on millions of systems around the world for mission-critical workloads. It instantly delivers Microsoft Windows and Linux desktop operating environments to thousands of users from centrally managed servers in the data centre. It lets users remotely access their individual desktops from nearly any client device, including thin clients or re-purposed PCs. With Red Hat Enterprise Virtualization for desktops, you get cross-platform support and a great user experience with the freedom of an open source foundation.

VmWare | Bengaluru VMware virtualisation lets its clients run multiple operating systems and applications on a single computer, consolidate hardware to get vastly higher productivity from fewer servers, and save 50 per cent or more on overall IT costs. It also offers speed and simplifies IT management, maintenance, and the deployment of new applications.

Wipro | Bengaluru Wipro's Storage Virtualization Platform solution enables a virtualised platform for the development of storage applications like mirroring and de-duplication in an R&D set-up, thereby enabling easy debugging of the components. The storage virtualisation framework developed by Wipro is a convenient way to implement virtualisation applications without getting into the kernel and device driver intricacies. This easy-to-debug model provides a framework for easy testing of core algorithms.

Read Open Source For You: Asia’s Leading Open Source Magazine 106  | march 2013 | OPEN SOURCE FOR YOU



TIPS

&

TRICKS

How to check the date and time the system was rebooted

sudo kill “PID”

Here is a simple command to check the system’s reboot date and time:

…where PID is the process ID of Xorg. This will reload the XWindows System.

#last reboot reboot

system boot 2.6.18-53.el5

Note: You must have root access to use these commands

Sat Aug 6 18:02

(8+04:45)

—Indermohan Singh, indermohansinghk7@gmail.com

wtmp begins Sat Aug 6 18:02:07 2011

The command below will give you the date and time the system was booted: #who -b system boot 2011-08-24 09:43

—Sumit Chauhan, sumit1203@gmail.com

Reloading XWindows System

Sometimes, while working on a Linux-based computer, XWindows System doesn’t respond very well. Here are the steps to reload XWindows System in a non-responsive Ubuntu system. 1. First open the command mode by pressing: Ctrl + Alt + F2 …and then entering your username and password. 2. Then run the following command: top

Handling log files

As developers, we do a lot of testing after coding the software and we frequently need to handle the log files to identify the errors in the code of an application program. Given below are the steps to handle various log files that are being generated on a Linux system. 1. Clearing a log/text file:

The above command will clear all contents of the file. 2. To view the log/text file:

pgrep Xorg

“f”

108  |  march 2013 | OPEN SOURCE FOR YOU

$ tail -f filename

This command will display the file contents as and when the log is written. It also displays the flow of the log. 3. To use more sophisticated tools on log files:

Search the process named ‘Xorg’ in the list. If it does not appear, wait for a few seconds. Then find the PID of the ‘Xorg’ process, listed at the extreme left of the output on the top. You can also get the PID using the command given below:

3. Now run the following command to kill the Xorg process:

$ >filename

$ less filename

This will display the log file contents. You can also use the commands below while using less. a. To refresh the log automatically, press:

after issuing the less command.


b. To stop refreshing the logs, press:

Counting the number of files in a directory

Here is a simple command that can count the number of files in a directory (not the hidden ones):

CTRL + C echo * | wc -w

c. To scroll up, press:

—Anil Awasare, anil.awasare@gmail.com

w

Find and move files

d. To scroll down, press:

You can find and move files in two steps. Step 1 enables you to find all files with .mp3 as the file extension. In Step 2, you can move them. Step 1:

d

e. To exit the mode, press:

[narendra@ubuntu]$ find DIR_NAME -type f -iname “*.mp3”

CTRL+C

and then press

./dir2/f4.mp3 ./dir2/f3.mp3 ./dir1/f2.mp3

q

—Pranavam Siddharthan, pranavam.s@gmail.com

Changing file names from upper case to lower

To manually change the case (upper to lower or vice versa) of a large number of files can be tedious. So, here is a script that can make life easy:

#to change uppercase filenames to lowercase

Note: Replace DIR_NAME with your actual directory name. In the above example, you are only finding the files (that’s why you used -type f) that have extension ‘.mp3’. Now you can move these files by using the ‘-exec’ option of the ‘find’ command. Step 2:

#!/bin/sh if [ $# -eq 0 ] ; then

[narendra@ubuntu]$ find DIR_NAME -type f -iname “*.mp3” -exec

echo Usage: $0 Files

mv {} /tmp/mp3/ \;

exit 0

Here, ‘{}’ matches each filename which is found by the ‘find’ command. And ‘\;’ is used to indicate the end of the command. After executing this command, all mp3 files are moved into the ‘/tmp/mp3’ directory.

fi for f in $* ; do g=`echo $f | tr “[A-Z]” “[a-z]”` echo mv -i $f $g mv -i $f $g done

If you want to change the case from lower to upper, replace

—Narendra Kangralkar, narendrakangralkar@gmail.com

g=`echo $f | tr “[A-Z]” “[a-z]”`

with

Share Your Linux Recipes! g=`echo $f | tr “[a-z]” “[A-Z]”`

in the script. —Anil Awasare, anil.awasare@gmail.com

The joy of using Linux is in finding ways to get around problems—take them head on, defeat them! We invite you to share your tips and tricks with us for publication in OSFY so that they can reach a wider audience. Your tips could be related to administration, programming, troubleshooting or general tweaking. Submit them at www.linuxforu.com. The sender of each published tip will get a T-shirt.

OPEN SOURCE FOR YOU | march 2013  |  109


offe

rS

Get Free Trial! watch Offer to is out th 3 ‘1 March

THE month

10% eNlight Cloud Computing Services by ESDS Test how our Cloud Works: http://demo.enlightcloud.com/ Login Details: Username: demo@demo.com; Password: demo For more information, call us on 1800-209-3006/+91-253-6636500 or email us at sales@esds.co.in

OFF! Welcome 2013! Direct 10% discount on every course! Hurry!d till ali Offer vrch 2013! a 31st M

www.esds.co.in

20% OFF!

www.grras.org

FRANCHISE Offers! 20% Discount on RHCVA course

Partner with a Global Brand!

Get trained at "India's Most Loved Linux Training Company" offering 20% Discount on RHCVA course. Hurry!d till ali Offer vrch 2013! a 31st M

Contact Ms. Shivani Sharma on +91-9310024501 or write to info@networknuts.net & mention COUPON CODE: OSFY

Hurry!d till ali Offer vrch 2013! a 31st M

www.networknuts.net

www.astTECS.com

Free

Pay for 1 & Get 1 Absolutely Free! Linux Plus Solaris Bundle Offer! Get Trained & Certified on RHEL6 and Avail Solaris Training absolutely FREE!!! Contact Tuhin on +91-98300 75018

Live Online Session

Get 1 month Free one month free Fully Managed Enterprise Class Dedicated Server Intel Xeon Quad Core, 16GB RAM, 2 x 1TB HDD in Indian Data Center with FREE Plesk Control panel

Hurry!d till ali Offer vrch 2013! a 31st M

www.aemk.org

*On pre-payment of six months. Call us at +91 (22) 6781 6699 or write to sales@qualispace.com & mention COUPON CODE: OSFY

www.qualispace.in

Get free advertisement Live online session

Add an Ad to your Ad for Free!!!

“Live online session on " Implementing Replication & High Availability in PostgreSQL" am arch, 7 12th M:30am IST to 11

Get 50% off on franchise fees! Be your own boss with significant earning potential Contact us at +91-98868 79412 / +91-80-42425000 or write to info@astTECS.com

Get 1 month

Free Training!

Hurry!d till ali Offer vrch 2013! a 31st M

Coupon Code: 2013welcome Contact us on +91-98877 89124 or write to info@grras.com Catch us on facebook.com/grras

Price: $99 only, Write to us at trainingsindia@enterprisedb.com for more details & group discounts."

www.enterprisedb.com

Hurry!d till ali Offer vrch 2013! a 31st M

New Financial year offer!! Pay for 1 advertisement and get another absolutely free in your favourite Open Source Magazine. Contact Omar on +91 995 888 1862 or write to efyenq@efyindia.com.

www.linuxforu.com


CALENDAR FOR-2013 eVENTS TO LOOK OUT FOR IN 2013 Date

Name of the event

description

location

website

5th – 6th Mar, 2013

The Mobile Strategy Summit

From identifying the building blocks for a successful Mobile strategy to understanding the power of analytical data from all the mobile sources, this summit has it all.

The Taj Mahal Hotel, New Delhi Contact: Kia Harry, Marketing Executive; +91 8105095358; kia.harry@ fleminggulf.com

http://www.fleminggulf.com/conferenceview/The-MobileStrategy-Summit/408

5th – 7th Mar, 2013

Gartner Symposium/ITxpo Dubai, U.A.E.

Industry's only event to deliver the insights, tools and relationships necessary to create, validate and execute transformative business technology strategies.

Madinat Jumeirah Hotel, Dubai, U.A.E.

http://www.gartner.com/ technology/symposium/ dubai/

6th – 10th May, 2013

Interop, Las Vegas

A place for thousands of information technology professionals to gather for networking.

Mandalay Bay, Las Vegas

http://www.interop.com/ lasvegas/

13th – 14th May, 2013

Gartner IT Infrastructure Operations & Data Center Summit

This Summit offers guidance on turning today's improvements in IT infrastructure and process efficiency into tomorrow's business advantage.

Grand Hyatt, Mumbai

http://www.gartner.com/ technology/summits/ apac/data-center-india/

23rd – 24th May, 2013

Cloud Connect

A focused conference that will bring together the entire ecosystem of the cloud.

NIMHANS Convention Center, Bengaluru

http://www.cloudconnectevent.in/

10th – 11th Jun, 2013

Gartner Business Intelligence & Information Management Summit

This summit provides Business Intelligence professionals and IT executives with world class research.

Grand Hyatt, Mumbai

http://www.gartner.com/ technology/summits/ apac/business-intelligence-india/

12th – 14th Jun,2013

The Global High on Cloud Summit

Through the Global High on Cloud Summit will address the issues, concerns, latest trends, new technology and upcoming innovations on the Cloud platform which will give an open forum and opportunity to everyone in the industry to come together and share their ideas & updates and provide a global outlook.

Mumbai Contact: Prashanth Nair; Sr. Conference Producer; Contact No.: +91-8041154921; E-mail ID : contactus@besummits. com

http://www.theglobalhighoncloudsummit. com/

18th – 21st Jun, 2013

CommunicAsia2013 / EnterpriseIT2013

Being the Asia’s largest integrated info communication technology event, it is instrumental in connecting the ICT industry.

Marina Bay Sands, Singapore

www.CommunicAsia. com & http://www.gotoenterpriseit.com/

30th Sep – 4th Oct, 2013

Interop, New York

Interop New York offers sessions and networking opportunities open to all attendees including Vendor Sessions, Cloud and Virtualization Theater Sessions, InteropNet tours and classes and Speed Networking.

Javits Center, New York

http://www.interop.com/ newyork/

21st – 23rd Oct, 2013

Gartner Symposium/ITxpo, Goa

The world's most important gathering of CIOs and senior IT executives.

Goa

N.A.

Open Source India

It is the premier Open Source conference in Asia targeted at nurturing and promoting the Open Source ecosystem in the subcontinent.

NIMHANS Convention Center, Bengaluru Contact: Atul Goel; Ph011-26810601/2/3; E-mail: osidays@efyindia.com

http://osidays.com/ osidays/

13th – 15th Nov, 2013

110  |  March 2013 | OPEN SOURCE FOR YOU



Mainstream Enterprise Adoption of Open Source Databases A conversation with Ed Boyajian, CEO, EnterpriseDB

Are enterprises embracing open source database software today? Absolutely. In 2012 we counted 32 of the Fortune 500 as customers and 47 of the Global 1000. That includes some of the biggest IT users in the world. IT operations at the Federal Aviation Administration, the US State Department, Fujitsu, Sony-Ericsson and Sony Online Entertainment are all using Postgres or Postgres Plus from EnterpriseDB. Interestingly, also noteworthy, companies like VMware, Microsoft (through its acquisition of Skype), Apple and Facebook (through its acquisition of Instagram) are using PostgreSQL. We are at the beginning of an explosion. Companies are finding that for a fraction of the cost of traditional databases, PostgreSQL can deliver the sophisticated features and capabilities they require. PostgreSQL has had decades of hardening and development by a talented and committed community of developers as well as a fast-growing, supportive ecosystem of database specialists.

How difficult is it to migrate to a new database? EnterpriseDB has developed a proven Oracle compatibility solution that enables our customers to run many Oracle applications using Postgres Plus. Postgres Plus natively supports many of Oracle’s system interfaces, facilitating migrations with minimal cost, risk and disruption. Existing technical staff – from developers to DBAs to operations teams – leverage existing Oracle skills to build and manage Postgres Plus databases. EnterpriseDB also has developed a comprehensive migration program that begins with an Oracle migration assessment and provides support and assistance with the process all the way through to deployment.

What happens after Postgres databases are deployed? Regardless of whether an organization is deploying applications based on community PostgreSQL or Postgres Plus, EnterpriseDB provides a portfolio of solutions that ensure success. We have made the long-term commitment to meeting the demands of the enterprise with Postgres-specialized products, Hurry! Offer expires September 30, 2012 support, and services. What’s more, we are continually developing new Postgres database enhancements and sponsoring the efforts of the PostgreSQL community. More than 2,000 organizations around the world turn to EnterpriseDB for Postgres-related products and services.

Contact us today about : • Software Subscriptions • Technical Support 24x7x365 • Migration Assessments • Training for Administrators and Developers • Professional Services * Call: +1 781-357-3390 or 1-877-377-4352 (US Only), Email: info@enterprisedb.com EnterpriseDB Software India Private Limited Unit # 3, Ground Floor, Godrej Castlemaine, Sassoon Road Pune – 411001

Test, develop and T deploy your application VMware vCloud powered cloud +91 20 3058 9500 Fon +91 20 3058 9502 www.enterprisedb.com Avail free cloud credit worth ` 25,000*, visit www.cloudinfinit.com for more details


Powered By

www.facebook.com/linuxforyou

Vinay Gowda:

I have installed Ubuntu 12.10 on my lenovo(G580) laptop, but the network(wired) is not up. Can any one help me? Like . comment

Riya Patankar: Have you tried running ifup eth0 or dhclient eth0 as root ?

Avinash Kumar Chaurasia: What does it say? Possibly your ethernet is not supported. First check the ethernet specifications. Then install ethernet driver for your hardware.

Vinay Gowda: #ifconfig eth0 --> eth0: error fetching interface information: Device not found #ifconfig eth0 up --> eth0: ERROR while getting interface flags: No such device. Even I tried to install the drivers, but non of them are working. Avinash Kumar Chaurasia: I don't know what driv-

ers you are trying. It must be hardware specific.

Spencer Allen: I recommend investing in a USB

Wifi adapter.Sometimes the Kernel needs to be patched in order to support the latest hardware. It seems to happen most frequently with networking adapters and it can take a long time for the Kernel patches to get developed and make their way to the various distros. So having a network adapter that you can plug into any machine that is already supported is a huge bonus. Here's a list of currently supported USB Wifi adapters to choose from. http:// wireless.kernel.org/en/users/Devices/USB

Safiyat Reza: I want to build a custom system based on

GNU\Linux for use by (primarily) my parents and friends (almost all novice). Which Linux OS should I start out with, to build upon it? Please suggest a small, all stripped OS, which is rock solid stable, so that I only will have to custom compile and build the applications on it. Suggest a powerful base system.

Like . comment

Mthura Startx Aviwe Musa:

How do I install WVdial on Backtrack 5 R2 offline? Like . comment

Riya Patankar: Go to the backtrack repo site, search for the package, download it and install it. It has some dependencies- approximately 3 (as far as I remember). Mthura Startx Aviwe Musa: Riya, thank you mate.

Bera From-Vindhyanagar Somnath:

Is there any way to install Arduino IDE on Raspberry PI ? Any research anywhere? Like . comment

Binoy Xavier Joy: Yes you can. Enter sudo apt-get install arduino in terminal.

Bera From-Vindhyanagar Somnath: Thanks, but on my wheezy linux Raspberry Pi, it's not working.

Binoy Xavier Joy: Update first and then try. Run this first. sudo apt -get update. Bera From-Vindhyanagar Somnath: Even then ...it says unable to locate package arduino. Yes... it works now... Thanks! Ashwith Rego:

Is there a way I can make Gnome 3.4 extensions work on 3.6? The Axe Menu extension is really neat but the developer hasn't updated it for Gnome 3.6 yet. Like . comment

Riya Patankar: Go to the jason file of the extension and replace 3.4 with 3.6. Ashwith Rego: Thanks! I was able to enable the extension with that but it looks like there is still a problem. If I click the menu once, it works. After that, every subsequent click opens the Documents directory.

Spencer Allen: What you described is Arch.

Riya Patankar: Search the same extension on

Riya Patankar: It's better if you opt directly for

Ashwith Rego: I did. The developer is yet to update it for Gnome 3.6. It worked fine on 3.4.

Jatin Khatri: Is it something like http://www.linux-

Riya Patankar: Then, that's your hard luck.

https://wiki.archlinux.org/index.php/The_Arch_Way

Pear OS.

fromscratch.org/?

Image quality is poor as the photos have been directly taken from www.facebook.com 12  |  March 2013  |  OPEN SOURCE FOR YOU

extensions.gnome.org.

Either search an alternative or wait for its update.


Q&A Akram Wazeer:

find / user tom > /home/tom.files find / user tom -exec cp {} /tmp/tom / \ ; useradd tom -s /sbin/nologin Can any linux geek let me know whether these commands are correct? Also, if possible let me know how to extend a volume group via physical extents and also an example on how to reduce a existing volume group by 100MB? Like . comment

Jatin Khatri:

1) it must be find / -user tom > /home/tom.files , ( if you want to find files created by user tom and what to get a list of that file ( tom.file ) in tom's home directory) 2) it must be find / -user tome -exec cp {} /tmp/ tom \; I.E find /path/to/search -name "*.doc" -exec cp {} /path/to/copy/to \; ( this command will copy .doc files from the given path and copy it to said path ) 3) it's ok if you wnat to add user tom with no intractive login to system

Abhishek Yadav:

Which open source OS is good for linux beginners?. Like . comment

Facebook

Joko Rasminto:

Hi, how to install Ubuntu on Windows 7 starter? Like . comment

Spencer Allen: https://www.virtualbox.org/. Joko Rasminto: Thank you.. Sumant Garg: You can also make a dual boot system.

Magimai Prakash:

Why most of the Linux distributions have Python 2.7 and why not Python 3? Like . comment

Spencer Allen: 1. Python 3 is new. 2. Python 3 is not backward compatible with Python 2, so simply using Python 3 instead Python 2 will break the system. 3. It will break existing apps. Python 2.7 is the final major release of Python 2.x series, so it will remain in the distros even after switching to Python 3. Magimai Prakash: Thank you..

Riya Patankar: Mint, Pear OS, Ubuntu for absolute beginners fedora for beginners, arch and Slackware for advanced users.

Tlhologelo Mabitle: Ubuntu. Ix Mundz: Suse. Subin M Thevalakkattu: Fedora.

Manas Halder:

I have multi-booted operating System- one is Windows XP and another one is CentOS 6.2. I am using Airtel 3G Dongle for Internet. The problem is that: If CentOs first boots, then Airtel 3G dongle does not detect the network. But after Booting WIN XP 2, if I restart and boot CentOS 6.2, then Airtel 3G Dongle works and shows it is ready for the internet. Can anyone help me? Like . comment

Riya Patankar: Try wvdial. Pradeep Singh:

Can any one help me in understanding the relation between ISCSI and FTP? I think both works for data transfer. If I am right in my thinking, then why we introduced ISCSI? Like . comment

Jeet Singh: AFAIK : ISCSI is for Netgear NAS ::

and FTP for a wider approach. Please correct me if I am wrong.

Yogesh Jadhav: Insert your dongle in back side of the USB port instead of the front one and then try.

Karthigeyan Kith: How to use Windows office document in Linux?

Like . comment

Debashis Sarkar: odt or doc format opens in

libre office.

Pradeep Singh:

Hey friends, I want to get a USB Internet Data card for 1GB/month high speed access. Which will be the best service provider in terms of speed and coverage area? - Airtel/Vodafone/Reliance/Tata/BSNL/IDEA/MTS or any other? The device should support Linux OS! Like . comment

Jeet Singh: Tata is best bet. But again it depends on your locality .. "AFAIK Tata is best in terms of speed and network. I personally used it in Mumbai, Rajasthan and Punjab.

Karthigeyan Kith: What about others like Excel?

Riya Patankar: Libreoffice spreadsheet is just an example of such softwares.

Subin M Thevalakkattu: Open windows office document in Libre office application.

Sumant Garg: You can also use Apache open office in Linux.

Image quality is poor as the photos have been directly taken from www.facebook.com OPEN SOURCE FOR YOU | MARCH 2013  |  13





Enterprising Solutions, Enabling Businesses

Visit EnterpriseIT2013 if you are from the following industries...

Banking & Finance

Education

Government / Military / Defense

Healthcare

Logistics / Transportation

Hospitality / Retailers / Services


Tablets Simmtronics XPad X1010 Android 4.0 February 2013

Specification:

OS:

Launch Date:

February 2013

Launch Date:

MRP:

MRP:

MRP:

` 6,499

MRP:

` 8,399

Android 4.0

February 2013

Launch Date:

ESP:

OS:

Launch Date:

Android 4.1 aka Jelly Bean

OS:

` 8,399

Videocon VT 71

OS:

Champion Computers Wtab 705 Talk

Lava E-Tab Xtron

NEW

10.1-inch capacitive touchscreen, 1024 x 600 pixels screen resolution, 1.2 GHz processor, 5,600mAh battery, 0.3MP front-facing camera, 8 GB internal memory, expandable up to 32 GB, 3G, Wifi

NXG Xtab A9 Plus

Specification:

NEW

7-inch IPS multi touchscreen, 1024 x 600 pixels screen resolution, 1.5 GHz dual core processor, 3500 mAh battery, 2 MP rear camera, 8 GB internal memory, expandable up to 32 GB, WiFi

HCL Me V1

OS:

Android 4.0

OS:

Android 4.0

Launch Date:

January 2013

Launch Date:

January 2013

MRP:

` 8,990 ESP:

` 6,990

NEW

Specification: 17.7-cm (7-inch) IPS display touchscreen, 1.2 GHz processor, 3,600 mAh battery,2 MP rear and VGA front-facing camera, 8 GB internal storage, expandable via microSD, 3G via dongle, WiFi

Karbonn Smart Tab 8 Velox OS:

Android 4.1 aka Jelly Bean

MRP:

` 7,999 ESP:

` 7,899 Specification: 7” WVGA capacitive touch screen,800 x 480 pixels screen resolution, 1 GHz cortex processor,3200 mAh battery, 2 MP rear camera 0.3 MP front camera, 4 GB internal memory, expandable up to 32 GB, 3G, WiFi

Specification: 20.3-cm (8-inch) capacitive display touchscreen, 1024 x 768 pixels screen resolution 1.5 GHz dual-core processor, 4,500 mAh battery, 3 MP rear and VGA front camera,1.5 GB internal storage, expandable upto 32 GB, WiFi

Simmtronics XPAD X-720

Android 4.1 aka Jelly Bean Launch Date:

January 2013 MRP:

` 7,600 ESP:

OS:

Android 4.0 Launch Date:

January 2013 MRP:

` 5,499

` 7,600

ESP:

Specification:

Specification:

25.6-cm (10.1-inch) IPS display touchscreen, 1.5 GHz dual-core processor,7,600 mAh battery, 3 MP rear and VGA front camera, internal storage of 16 GB, expandable up to 32 GB, 3G, Wifi

` 5,499 17.7-cm (7-inch) capacitive display touchscreen, 1 GHz processor, 2,800 mAh battery,0.3 MP front camera,4 GB internal storage, expandable up to 32 GB 3G, Wifi

Launch Date:

December 2012

MRP:

MRP:

MRP:

` 15,990

` 11,200

ESP:

ESP:

ESP:

` 10,990 ` 10,990 Specification: 17.7-cm (7-inch) IPS display touchscreen, 1.6 GHz dual-core processor, 4,100 mAh battery, 2 MP rear and 0.3 MP front camera, 8 GB internal storage, expandable up to 64 GB, 3G, Wifi

Lenovo Ideapad A2107

` 13,999

17.7-cm (7-inch) capacitive display touchscreen, 1 GHz processor, VGA front camera, 2,800 mAh battery, 4 GB internal memory, expandable up to 32 GB, Wi-Fi, 3G via dongle

Lava eTab Z7H

OS:

December 2012

MRP:

Specification:

7-inch (17.8 cm) capacitive touchscreen, 800 x 480 pixels screen resolution, 1.2 GH processor, 3200 mAh battery, 4 GB internal memory, expandable up to 32 GB, 3G, Wifi

Android 4.1 aka Jelly Bean

December 2012

` 4,600

NEW

Launch Date:

Launch Date:

ESP:

Specification:

Launch Date:

Android 4.0

` 4,600

Spice Stellar Pad Mi-1010

` 4,529

OS:

OS:

December 2012

17.8 cm capacitive touchscreen, 480 x 800 pixels screen resolution, 1.5 GHz processor, 4 GB internal memory, expandable memory up to 32 GB, it has built-in support for 2G network

ESP:

Android 4.0

OS:

Android 4.0

Specification:

NEW

OS:

MRP:

` 7,025

` 6,330

OS:

December 2012

ESP:

` 4,799

Videocon VT10

Launch Date:

` 7,025

ESP:

iBerry Auxus CoreX4

iBerry Auxus CoreX2 Android 4.1 aka Jelly Bean

January 2013

January 2013

` 6,330

ESP:

` 6,499

Android 4.0

` 15,990 Specification:

25.6-cm (10.1-inch) IPS display touchscreen, 1280 x 800 pixels screen resolution, 1.5 GHz dual-core processor,6,800 mAh battery,2 MP front and rear camera,8 GB internal storage, expandable up to 32 GB, 3G, WiFi

Intex iBuddy Connect

Go Tech funTab All New

OS:

OS:

Launch Date:

Launch Date:

Android 4.0

MRP:

December 2012

` 13,999 Specification: 17.7-cm (7-inch) HD display touchscreen, 1024 x 600 pixels screen resolution, 1 GHz Mediatek processor, 2 MP rear and 0.3 MP front camera, 16 GB internal memory, expandable up to 32 GB 3G, WiFi

18  |  March 2013 | OPEN SOURCE FOR YOU

Specification:

24.6-cm (9.7-inch) IPS display touchscreen, 1.6 GHz quad-core processor,7,200 mAh battery, 2 MP rear and VGA front camera, 16 GB internal storage, expandable up to 64 GB, 3G, Wifi

Launch Date:

ESP:

` 11,200

MRP:

` 7990 ESP:

` 7990 Specification: 17.7-cm (7-inch) capacitive display, 1 GHz processor, 2 MP rear and VGA front camera, 3,000 mAh battery, 4 GB internal memory, expandable up to 32 GB via microSD, 3G, WiFi

Android 4.0 December 2012 MRP:

` 4000 ESP:

` 4000 Specification: 17.7-cm (7-inch) capacitive display touchscreen, 1 GHz processor, 3,600 mAh battery, 0.3 MP front camera, 4 GB internal memory, expandable up to 32 GB, 3G, WiFi


INSTALLATION MAINTENANCE

No Need To Pay For Software.

FREE DOWNLOAD

Your Window to FREE professional Software

Tablets Karbonn Smart Tab10

Mercury mTAb StreaQ

OS:

Android 4.1 Launch Date:

December 2012 MRP:

` 10,940 ESP:

` 10,940 Specification: (9.7-inch) capacitive display touchscreen, 1.5 GHz processor, 6,000 mAh battery, 2 MP rear camera, 1 GB RAM, 3G, WiFi

Karbonn Cosmic Smart Tab OS:

Android 4.1 Launch Date:

December 2012 MRP:

` 10,280 ESP:

` 10,280 Specification: 24.6-cm (9.7-inch) capacitive display touchscreen, 1.5 GHz processor, 6,000 mAh battery, 1 GB RAM, 2 MP rear and VGA front camera, Wi-Fi,3G via dongle

Wishtel PrithV OS:

Android 4.0 Launch Date: MRP:

` 3,300 ESP:

` 3,300 Specification:

*The logos used in this banner are the properties of their individual organizations.

Contact us : 080-4242-5042, E-mail: contact@myOpenSourceStore.com, www.myOpenSourceStore.com

December 2012

7-inch TFT (LCD), capacitive display, 800 MHZ processor, 2800 mAh battery, 0.3 MP camera, supports up to 32GB MicroSD Card3G, WiFi

OS:

Android 4.0 Launch Date:

December 2012 MRP:

` 11,499 ESP:

` 11,499 Specification: 17.8-cm (7-inch) capacitive multitouch screen, 1024 x 600 pixels screen resolution, 1.2 GHz processor, 2 MP rear camera, 4 GB built-in storage, expandable to 32 GB, 3G, WiFi

Swipe Legend Tab OS:

Android 4.0 Launch Date:

December 2012 MRP:

` 11,999 ESP:

` 11,999 Specification: 7-inch TFT LCD capacitive touchscreen, 800 x 400 pixels screen resolution, 1.5GHz processor, 2 MP rear and 1.3 MP front camera, 4 GB internal memory, expandable up to 32 GB, 3G, WiFi

Laptops Ambrane Mini OS:

Android 4.0 Launch Date:

November 2012 MRP:

` 5,499 ESP:

` 5,499 Specification:

7 inches TFT capacitive touch screen, 800 x 480 pixel screen resolution, 1.2 GHz processor, 3000 mAh battery, Built-in 0.3 MP camera, WiFi

Netbooks Samsung N100

ASUS EeePC X101

OS:

MeeGo

OS:

Launch Date:

August 2011

Launch Date:

MRP:

` 12,290

MRP:

ESP:

ESP:

` 11,840 Specification: 25.7 cm WSVGA anti-reflective LED,1024×600 pixel screen resolution,1.33GHz Intel ATOM processor, 1GB DDR3 memory, Intel GMA 3150 graphics, 250GB HDD, 3 cell (40 W) battery, 4-in-1 card reader, 1.03kg. Retailer/Website: Croma Store, Saket, New Delhi, +91 64643610

NEW

MeeGo August 2011 ` 12,499 ` 12,000 Specification: 25.7 cm LED-backlit screen, Intel Atom processor N455 CPU, 1GB DDR3 RAM expandable upto 2GB, 220GB storage, Bluetooth 3.0, Wi-Fi 802.11 b/g/n, 17.6mm thick, 920g. Retailer/Website: Eurotech Infosys, Nehru Place, Delhi, 9873679321

OPEN SOURCE FOR YOU | March 2013  |  19


OPENGADGETS SMARTPHONES Micromax A116 Canvas HD OS:

Android 4.1 aka Jelly Bean Launch Date:

` 3,400

` 15,000 Specification:

Launch Date: MRP:

MRP:

` 15,000

Android 2.3 February 2013

February 2013 ESP:

Spice Stellar Buddy Mi 315 OS:

NEW

12.7-cm (5-inch) IPS LCD touchscreen, 1280 X 720 pixels screen resolution, 1.2GHz quad core processor,8MP rear camera, 4GB of internal storage and supports microSD card up to 32GB, GPS with GLONASS and A-GPS, 3G, Wifi

Micromax A27 Ninja

ESP:

` 3,400 Specification:

NEW

3.2-inch capacitive touchscreen, 1 GHz processor, 1400 mAh battery, 3.2 MP rear camera, 170 MB internal memory, expandable up to 32 GB, supports 2G network, WiFi

Umi X1

NEW

` 9,990

ESP:

` 3,899 Specification:

NEW

ESP:

` 9,990 Specification:

NEW

4.5 inch capacitive touchscreen,1 GHz dual core processor, 960 X 540 pixels screen resolution,1 GHz dual core processor, 1800 mAH battery, 8 MP rear camera, 1.93 GB internal memory, expandable upto 32 GB, 3G, WiFi

Lava Iris 501

` 19,999 ESP:

` 9,999

OS:

Android 4.0 Launch Date:

January 2013

` 5,999

NEW

Specification:

ESP:

` 5,999 Specification:

MRP:

NEW

iBall Andi 4.5Q Launch Date:

Launch Date:

January 2013

January 2013

NEW

Specification:

ESP:

` 10,799 Specification:

NEW

Huawei Ascend G600

Huawei Ascend G330

OS:

OS:

Android 4.0

Android 4.0

Launch Date:

Launch Date:

January 2013

January 2013

MRP:

MRP:

` 14,990

` 11,490

ESP:

ESP:

4.5-inch LCD IPS QHD display touchscreen, 960 x 540 pixels screen resolution,1.2GHz dual-core processor,1,930 mAh battery,8 MP rear camera,4 GB internal memory, expandable up to 32 GB, 3G, Wifi

Specification:

ESP:

` 45,990

NEW

Zync Z5 Phablet OS:

Android 4.0 Launch Date:

January 2013 MRP:

` 11,990

NEW

January 2013 ` 15,000

12.7-cm (5-inch) full-HD display touchscreen, 1920 x 1080 pixels screen resolution, 1.5 GHz quad-core processor, 2,020 mAh battery, 2 GB RAM,8 MP rear and 2.1 MP front-facing camera, 16 GB internal storage, expandable via microSD, 3G, WiFi

4-inch capactive touch screen display, 800 × 480 pixels screen resolution, 1 GHz dual-core Qualcomm processor, 1,500 mAh battery, 5 MP rear camera, 4 GB internal memory, expandable up to 32 GB, 3G, Wifi

20  |  March 2013 | OPEN SOURCE FOR YOU

` 49,900

Android 4.1 aka Jelly Bean Launch Date: MRP:

Specification:

11.4-cm (4.5-inch) qHD display touchscreen, 1 GHz dual-core processor, 2,050 mAh battery, 512 MB RAM, 8 MP rear and VGA front-facing camera,4 GB internal storage, expandable up to 32 GB, 3G, WiFi

` 10,990

Android 4.1 aka Jelly Bean MRP:

1.2 GHz dual-core processor, 2,550 mAh battery, 8 MP rear and 5 MP front-facing camera,16 GB internal storage capacity, expandable up to 32 GB, 3G, WiFi

NEW

OS:

January 2013

` 11,490

NEW

OS:

Launch Date:

MRP:

MRP:

` 9,999

NXG XFAB Mini 2

HTC Butterfly

Android 4.1 aka Jelly Bean

Android 4.0

ESP:

5.0 WVGA touchscreen, 480 x 800 pixels screen resolution, 1 GHz processor, 2300 mAh battery, 512 MB RAM, 5 MP rear camera, memory expandable up to 32 GB, 3G, WiFi

OS:

OS:

` 9,999 Specification:

4.0-inch WVGA capacitive touchscreen, 1 GHz processor, 512 MB RAM, 1,500 mAh battery, 3 MP rear, front VGA camera,3G, Wifi

11.4-cm (4.5-inch) HD display touchscreen, 1280 x 720 pixels screen resolution, 1 GHz processor, 1,750 mAh battery, 8 MP rear and 2 MP front camera, 3G, Wifi

Spice Stellar Pinnacle Mi-530

Specification:

MRP:

` 3,899

MRP:

MRP:

8.8-cm (3.5-inch) capacitive touchscreen,480 × 320 pixels screen resolution, 1 GHz processor, 1400 mAh battery, 2 MP rear camera, 160 MB internal memory, expandable up to 16 GB, 2G, WiFi

` 14,990

February 2013

MRP:

February 2013

February 2013

` 3349

` 13,999

Launch Date:

February 2013

Launch Date:

Launch Date:

MRP:

ESP:

Android 4.1 aka Jelly Bean

Launch Date:

Android 4.0

Android 4.0

February 2013

` 13,999

Android 2.3

Videocon A27

OS:

Launch Date:

Specification:

OS:

OS:

Android 2.3

` 3349

Intex AQUA Wonder OS:

3.5-inch capacitive touchscreen, 320 x 480 pixels screen resolution, 1 GHz processor, 1300 mAh battery, 2 MP camera, 110 MB internal memory, expandable up to 16 GB, Wifi

OS:

ESP:

Lava IRIS 351

ESP:

` 12,490 Specification: 11.9-cm (4.7-cm) IPS display touchscreen, 1.2 GHz dual-core processor, 1 GB RAM, 2,000 mAh battery, 12 MP rear and 2 MP front-facing camera, 4 GB internal memory, expandable up to 32 GB, 3G, Wifi

Lava Iris 501 OS:

Android 4.0 Launch Date:

January 2013 MRP:

ESP:

` 10,000

` 9,490

ESP:

Specification:

` 10,000

5 inches TFT LCD capacitive touchscreen, 1 GHz processor, 2500 mAh battery, 8 MP rear camera, internal memory 4G and expandable up to 32 GB,3G, WiFi

Specification: 12.7-cm (5-inch) WSVGA display, 1 GHz dual-core processor,2,300 mAh battery, 5 MP rear camera and VGA front camera, 4 GB internal storage, expandable up to 32 GB, 3G, Bluetooth, Wi-Fi

NEW


OPEN GADGETS SMARTPHONES Zync 5-Inch Z5 OS:

Android 4.0 Launch Date:

January 2013 MRP:

` 9,490 ESP:

` 9,490 Specification: 12.7-cm (5-inch) TFT display touchscreen, 1 GHz processor,2,500 mAh battery,8 MP rear and 0.3 MP front camera, 4 GB internal storage, expandable up to 32 GB, 3G, Wifi

Swipe F1Phablet Android 4.0 Launch Date:

December 2012 MRP:

` 8990 ESP:

` 8990 Specification: 12.7-cm (5-inch) capacitive display touchscreen,1 GHz processor,2,500 mAh battery,5 MP rear and 0.3 MP front camera,internal memory 4 GB, expandable up to 32 GB, 3G, WiFi

Videocon A20

Videocon A30

OS:

OS:

Android 2.3

Android 4.0

Launch Date:

Launch Date:

December 2012

December 2012

MRP:

MRP:

` 4,999

` 7,299

ESP:

ESP:

` 4,999 Specification: 8.8-cm (3.5-inch) capacitive display touchscreen, Android 2.3 aka Gingerbread, 1 GHz processor, 1,350 mAh battery, 3 MP rear and VGA front camera, 3G, Wi-Fi

` 7,299 Specification: 10.1-cm (4-inch) capacitive display touchscreen, 1 GHz processor, 1,500 mAh battery, 5 MP rear and VGA front camera, 3G, WiFi

iBall Andi 4.5H

Karbonn A30

OS:

OS:

Launch Date:

Launch Date:

Android 4.0 December 2012 MRP:

` 14,995 ESP:

` 12,490 Specification: 4.5 inches (11.43 cms) capacitive touchscreen, 960 x 540 pixels screen resolution, 1 GHz dual-core processor, 1600 mAH battery, 8 MP rear camera, 4 GB internal memory, expandable up to 32 GB, 3G, WiFi

Android 4.0 December 2012 MRP:

` 12,990 ESP:

` 11,500 Specification: 5.9-inch capacitive touchscreen, 480 x 800 pixels screen resolution, 1 GHz processor, 2500 mAh battery, 8 MP camera, 4 GB internal memory, expandable up to 32 GB, 3G, Wifi

Lava Iris N320

Lava Xolo A700

OS:

OS:

Launch Date:

Launch Date:

Android 2.3 November 2012 MRP:

` 4,499 ESP:

` 3,999

Byond Phablet PIII

Huawei Ascend G330 OS:

OS:

Android 4.0 November 2012 MRP:

` 9,999 ESP:

` 9,999

Specification:

Specification:

8.12-cm (3.2-inch) capacitive touch screen, 240 x 320 pixels screen resolution, 1 GHz processor, 1400 mAH battery, 2 MP rear camera, 100 MB internal memory, expandable up to 32 GB, WiFi

11.4-cm (4.5-inch) IPS capacitive touchscreen, 960 x 540 pixels screen resolution, 1 GHz dual core processor, 5 MP rear camera, 4 GB internal memory, expandable up to 32GB, 3G, WiFi

Android 4.0

OS:

Android 4.1 aka Jelly Bean

Launch Date:

December 2012

Launch Date:

December 2012

MRP:

` 10,990

MRP:

` 15,000

ESP:

` 10,990

ESP:

` 15,000

Specification:

Specification:

10.1-cm (4-inch) capacitive display touchscreen, 1 GHz dual-core processor, 1,500 mAh battery, 5 MP rear and 0.3 MP front camera, 4 GB internal storage, expandable up to 32 GB, 3G, WiFi

15.2-cm (6-inch) display touchscreen, 1 GHz dual-core processor, 2,500 mAh battery, 8 MP rear and VGA front camera, 3G,Wi-Fi

Samsung Galaxy Music Duos

Lava Iris N400

OS:

Android 4.0 Launch Date:

December 2012

OS:

Android 4.0 Launch Date:

MRP:

December 2012

ESP:

` 6,399

` 8,999 ` 8,999 Specification: 7.6-cm (3-inch) QVGA display touchscreen, 850 MHz processor, 1,300 mAh battery, 3 MP rear camera, 512 MB RAM,4 GB internal memory, expandable up to 32 GB, Wifi

Lava’s Xolo A800 OS:

Android 4.0 Launch Date:

December 2012 MRP:

` 11,999

MRP:

ESP:

` 6,399 Specification: 4-inch TFT capacitive touchscreen, 400 x 800 pixels screen resolution, 1 GHz processor, 1500 mAh battery, 5 MP camera, 127 MB internal memory, expandable up to 32 GB, 3G, Wifi

ZOPO ZP900 S OS:

Android 4.0 Launch Date:

December 2012 MRP:

ESP:

` 15,999

` 11,999

ESP:

Specification: 4.5 inch IPS LCD capacitive touchscreen, 960 x 540 pixels screen resolution, 1600 mAh battery, 8 MP camera, 4 GB internal memory, expandable up to 32 GB, 3G, Wifi

Karbonn A15 OS:

Android 4.0 Launch Date:

November 2012 MRP:

` 5,899 ESP:

` 5,899 Specification: 10.2-cm (4-inch) LCD capacitive touchscreen, 800 x 480 pixels screen resolution, 1 GHz processor, 1,420 mAh battery, 3 MP rear camera, micro SD card slot supporting up to 32GB of expandable memory, 3G, WiFi

` 15,999 Specification: 5.3 inch QHD touchscreen, 1 GHz Dual Core processor.8 MP camera,4 GB internal memory, expandable up to 32 GB, 3G, Wifi

Karbonn A5+ OS:

Android 2.3 Launch Date:

November 2012 MRP:

` 5,990 ESP:

` 4,894 Specification: 3.5 inch capacitive touch screen, 320 x 480 pixels screen resolution, 1 GHz processor, 1420 mAh battery, 3 MP camera, micro SD card slot supporting up to 32GB of expandable memory 3G, Wifi

OPEN SOURCE FOR YOU | March 2013  |  21


FOSSBYTES Ubuntu phones to hit stores in October

It's official! The much-awaited Ubuntu-based smartphones will make their debut in October. It has been confirmed that the first lot of Canonical's Ubuntu Phone OS-based smartphones would arrive in the market by October this year. As reported by the Wall Street Journal, Mark Shuttleworth, founder and CEO of Canonical, has stated that the Ubuntu smartphones will be “available in two large geographic markets in October 2013.” Meanwhile, app developers can run the Ubuntu Phone OS on the Samsung-made Google Nexus smartphone. For developers, the Ubuntu Phone OS supports both native and Web or HTML5 applications. Web apps are first class citizens on Ubuntu, with APIs that provide deep integration into the interface. "HTML5 apps written for other platforms can be adapted to Ubuntu with ease, and we’re targeting standard cross-platform Web app development frameworks like PhoneGap to make Ubuntu ‘just work’ for apps that use them,” the official post states. Unlike Android, the Ubuntu Phone OS doesn't include many screen buttons and depends mostly on edge swipes.

You can now run Android natively inside the Windows OS

Wish to enjoy the complete Android experience on your Windows PC without a glitch? The developers at Socketeq have now made this possible. You can run the Android OS inside the Windows OS. The developers have made their software, WindowsAndroid, available for testing. WindowsAndroid runs Android on the Windows kernel instead of Linux. It is an ultra-swift transition because it takes away the emulation layer which is present otherwise. WindowsAndroid currently works with Google's Android 4.0 (ICS). All you need is the knowledge of how to work with the Android OS beyond its standard smartphone housing. So, if you are someone who has never hacked a smartphone or tablet before, do take your time to try this one out. But if you wish to try it out, you 22  |  March 2013  | OPEN SOURCE FOR YOU

LibreOffice 4.0 released

At a time when Microsoft is planning to bring out Office for Linux, LibreOffice has reached its version 4.0. The new LibreOffice has been released by The Document Foundation. It has several major improvements, like API changes and support for the Content Management Interoperability Services (CMIS) standard. The new version also has better import and export of native file formats for Microsoft Office programs, along with further improvement of Visio import filters with the addition of the 2013 version. One major addition in this release of LibreOffice includes the first release of Impress Remote Control App for Android, which is currently supported by some of the Linux distributions. The second release of the app is expected to arrive soon, which will be supported on all platforms—Windows, MacOS X, and all Linux distributions and binaries. LibreOffice Impress Remote is a free remote control app for presentations. With this, you can control your LibreOffice presentations from your Android smartphone.

The new version doesn't include many changes in terms of visual appearance, compared to the 3.6.x LibreOffice series. However, LibreOffice 4.0 comes with several tweaks in its user interface. The dialog boxes in this release are rendered. Other additional improvements in the user interface include Unity integration along with support of Firefox Themes (better known as Personas), which gives LibreOffice a personalised look.


FOSSBYTES can have fun running apps, 3D games and all of that, Socketeq promises. What is even more interesting is that you can work on Android depending upon the set-up you have in your Windows machine. WindowsAndroid can currently work on Windows 8, Windows 7 and Windows Vista, and the software can be downloaded from the Socketeq website. All you need to do is enter your email and some basic information. But before you press the download button, be sure of what you are going to do. Also, don't forget to check out BlueStacks, which helps in pushing Android apps to Windows and Mac computers.

Nokia 'open' to Android OS for tablet, says Nokia CEO

Nokia CEO, Stephen Elop, revealed that Nokia plans to build its own tablet and it would look at all possibilities (i.e., Android and Windows) for its OS. Nokia as a hardware brand has always been trusted by users across the globe. The only drawback for the Finnish handset maker over the past few years has been its reluctance to use Android instead of the more costly Windows OS. Tech freaks across the globe have listed their dream smartphone/tablet to be a Nokia device running the Android operating system. Stephen Elop, CEO, Nokia Considering the not-so-positive response to the Windows 8-based tablet, it would definitely make sense if Nokia is looking at offering its tablets at an affordable price range and could compete with Acer, Asus, Samsung, Amazon Kindle, Nook HD and many others. So, for the time being, let's sit back and enjoy the idea of an Android Nokia tablet.

Valve urges Windows’ Steam users to switch to Linux

If reports are to be believed, Valve's Steam gaming platform is making waves on the Linux operating system as well, and Valve is now promoting Steam for Linux to Windows users. At Steam’s website, Valve has launched a ‘Join the Beta’ promotion suggesting that users of other platforms, especially Windows, give ‘Steam for Linux’ a shot. Valve has even included a download link to get Ubuntu 12.04 LTS. With this, those who want to try Steam for Linux can get started instantly by installing Ubuntu 12.04 LTS with a click. This might be seen as a smart move from Valve, as Microsoft will take a couple of years at least to release the successor of Windows 8. If Windows users are alerted that switching to Linux is a piece of cake and requires no extra investment apart from the hardware compatibility, we can expect several users to abandon Windows or, at least, run Linux as well. Valve has begun listing the minimum Linux system requirements for games that are available on Steam for Linux. These system requirements support almost all of Steam's first-party titles. On the hardware front, users would need at least 512 MB of RAM along with a 2 GHz processor.

Now Android will help turbocharge wireless routers!

droidifi is developing an Android firmware upgrade for the latest Wi-Fi devices that unlocks their full potential, states the Kickstarter page for Droidifi. The developers want to port the Android smartphone operating system to wireless routers that can help power them efficiently. It is expected that the first version will be supported on the Cisco EA6500, Netgear R6300 and ASUS RT-AC66U. The above mentioned routers use IEEE 802.11ac to help them unleash Wi-Fi speeds of up to 1.7Gbit/s. In addition, they consist of a Gigabit Ethernet switch, USB ports, and processing power, memory and flash of 128 MB. The developers have even demonstrated an alpha version of the firmware, which can be administered using a browser via an HTML5 interface. Basic wireless and Ethernet functionality has also been implemented, but, say the developers, the alpha is still lacking a robust firewall, QoS functionality, port forwarding and other features. Droidifi is based on Android 4.2.2 (JellyBean), with the Linux 3.6.11 kernel used in that version getting a number of drivers added to it, stated a report. According to the developers, a simple firmware upgrade will add dozens of features and capabilities, including downloadable Android apps. This potential would mean that the router will have improved Wi-Fi power, simple connection of multiple wireless routers (mesh networking), and the ability to run Android apps on the router. OpenWRT and DD-WRT router firmware also offer similar functionality to Droidifi. They both are Linux-based and can function on a much wider range of wireless routers.

OPEN SOURCE FOR YOU | March 2013 | 23


FOSSBYTES

JavaScript to be the default language for GNOME

JavaScript is becoming a force to reckon with. GNOME developers have at last decided to stick to JavaScript to write applications for the desktop environment. However, the developers are still recommending C to write system libraries. “During the GNOME Developer Experience Hackfest this week, one of the major goals we identified was the need to pick a single language to give a simple answer to those who ask, 'How do I write a GNOME app?' Our decision is to support JavaScript as the first class language for GNOME application development,” read a blog posting by Collabora engineer and GNOME developer, Travis Reitter. Explaining the reason for choosing JavaScript, Travis added, “Our language of choice needs to be dynamic and high level. There is already momentum in the GNOME Project for JavaScript; it's used in GNOME Shell and GNOME Documents. There's a lot of work going into the language to make it especially fast, embeddable, and framework-agnostic. JavaScript is increasingly being seen as a first class desktop programming language; it is being used in Windows 8, in mobile platforms, and for local Web applications. JavaScript is self-contained; it doesn't come with its own set of core libraries, which makes it more convenient for us when integrating it into the platform.” Until now, there were no specific set of tools to write an application for the GNOME desktop environment. With this announcement, JavaScript will become the default language for GNOME applications.

24  |  March 2013  | OPEN SOURCE FOR YOU

The 'Me Against Rape' Android app to improve safety of women

Here comes an Android app that will help women to safeguard their right to freedom of mobililty and security. Named 'Me Against Rape', this safety mobile application has been developed by three engineers from Nashik in Maharashtra. The app is available for free download from the Google Play store for Android. It is for both smartphones and tablets. The app allows users to raise an alarm by sending a text message along with the location details to a pre-selected number. The app keeps sending updates of the changing location to the number every ten minutes, making tracking easy. It does not end here. The mobile can also start recording the incident, in case the victim wants to use it as evidence in court.

Mozilla introduces 'Boilerplate' to help developers make Firefox OS apps

Mozilla is running its Firefox operating system for smartphones on top gear, as developer Robert Nyman has announced a tool, which will help developers to start creating applications for the Firefox OS or even porting an existing Web application to it. Dubbed the Firefox OS Boilerplate App, the tool will have several basic features, which almost all applications have in common. “The idea is to avoid any dependency on external libraries or resources, but rather be self-contained,” wrote Nyman in a blog post. “As the name implies, Firefox OS Boilerplate App will provide you with the most basic features to get started with building an app from scratch, or tools to port your existing Web app. The easiest way to get started with installing it and testing the various features is to navigate to the Firefox OS Boilerplate App in the Web browser on a Firefox OS device or in the Firefox OS Simulator,” added Nyman.

Use your Android phone to pay your bills!

The Reserve Bank of India has given the go-ahead to a special card reader that will allow you to pay your bills via your Android phone. Priced at Rs 1500, the cigarette box-sized card reader that will come along with an Android phone, can perform all tasks that a POS terminal can. Citibank has taken the first step to adopt this technology, which has been developed by Bengaluru-based Ezetap Mobile Solutions. The company has obtained regulatory clearances for the launch of the card reader. To use the technology, the card reader has to be connected to an Android-based smartphone and a specified app is also required to run it. The merchants can also install the app on their mobiles, which can update their systems about the payment. According to the report, “The technology is not something new; the only difference is that while earlier innovations involved a separate platform, this one replicates the card POS and somewhat blurs the lines between credit card and mobile payments.”

Twitter rolls out Android update with new features

Twitter, the social messaging company, is rolling out its latest update for Android devices being used across the globe. This update is said to come


FOSSBYTES with new features that improve discovery and search on the site. The features are: 'Discover', 'Search', 'Connect' and 'Links'. The most important of the new features is the 'Discover' tab. This enables users to discover all the content in the tab by turning it into one giant, single stream that contains tweets, activities, trends and account suggestions. The new 'Discover' tab will be available on Android devices. Apart from retrieving content, navigation between ‘Activity’ and ‘Trends’ is also possible at the top of the ‘Discover’ tab. Next up is the 'Search' feature, which displays all relevant streams, similar to the stream in 'Discover', at one place. The ‘Connect’ feature now provides a simpler experience; the default view is ‘Interactions’, which shows you new followers, re-tweets and mentions. If you prefer to view only your ‘Mentions’ in ‘Connect’, you can adjust the default in ‘Settings’–find the 'Connect tab' option and select 'Mentions only'. And finally, there’s 'Links'. This feature lets you click on a URL in a tweet, go directly to that website from any timeline, and get to content highlighted on Twitter faster. Earlier, this was more cumbersome and lengthy. These updates are expected to offer a better experience for Twitter’s global user base.

A bracelet that can boot Ubuntu on any PC!

Barcelona-based Now Computing has come up with an Ubuntu product, which can make your computer childproof. Now Computing has launched an Ubuntu-based bracelet that can be plugged into a PC or a Mac to boot the Ubuntu Linux distribution. Dubbed as StormFly, it's a USB 3.0-based wristband. “When you plug StormFly into a Mac or PC, you reboot the computer, interrupt the boot process and then redirect all of the computer hardware to run everything from StormFly,” according to the company. The StormFly device has been priced at US$ 59 and is a 16 GB USB 3.0 flash drive with a bootable version of Ubuntu. But what is the point of having this device? “StormFly is perfect as a family computing solution. Unfortunately, the younger family members (and older ones) can often download the wrong things and slow the family computer down. Because StormFly acts as an independent computer, the operating system on the PC you use it on will not even turn on. Bottom line - if everyone uses a StormFly you prevent problems on your home computer. Happy kids. Happy you,” explained a company source.

TRAINING PARTNER

Speak and compose a mail with Chrome 25 Beta

A cursory glance at the headline and it might seem like a scene straight out of a sci-fi movie. But we are talking about the beta version of Google Chrome, which comes with the Web Speech API for developers. “With the inclusion of the Web Speech API for developers, users can start enjoying new, interactive experiences with Web apps— you can compose an e-mail by just speaking. With this new JavaScript API, developers can integrate speech recognition into their Web apps. So, in the near future, you’ll be able to talk apps into doing all sorts of things,” an official posting stated. If the feature works flawlessly, it would be welcomed by almost everybody. “Using your voice to search on your computer or phone is handy, and also if you could dictate documents, have a freestyle rap battle, or control game characters with your browser using only your voice. To make sure your Chrome installation isn’t being slowed down, the new Chrome Beta will automatically disable some extensions on Windows that may have been added by third party programs without proper acknowledgement from users. OPEN SOURCE FOR YOU | March 2013 | 25


FOSSBYTES

Google doles out Raspberry Pis to students

In an effort to boost coding knowledge among school children, Google has announced a generous grant, through which 15,000 Raspberry Pi Model B mini computers will reach school kids in the UK. The Raspberry Pi Foundation will be giving away these mini computers after selecting the children they believe would benefit from the Raspberry Pi. Google’s executive chairman, Eric Schmidt, along with Raspberry Pi founder, Eben Upton, visited Cambridge, and taught coding to local kids in a classroom recently. With Google's grant, more students will have access to the Raspberry Pi, which will help them get handson knowledge in a varied range of educational open source code. As to how the Raspberry Pi Foundation will shortlist students, “We’re going to be working with Google and six UK educational partners to find the kids who we think will benefit from having their very own Raspberry Pi. CoderDojo, Code Club, Computing at Schools, Generating Genius, Teach First and OCR will each be helping us identify those kids, and will also be helping us work with them,” the Raspberry Pi site reported. Initiatives like these indicate that big companies like Google understand the importance of imparting quality education to future innovators. With this grant, Google clearly showcased that it cannot wait for governments to take serious steps to build our future. “We’re incredibly grateful for Google’s help in something that we, like them, think is of vital importance. We think they deserve an enormous amount of credit for helping some of our future engineers and scientists find a way to a career they’re going to love,” the posting on the Raspberry Pi site added.

26  |  March 2013  | OPEN SOURCE FOR YOU

A new map editor for OpenStreetMap

The OpenStreetMap project has got a new Web-based map editor dubbed as iD editor from MapBox. The map editor is based on JavaScript and the D3.js data visualisation library, and has been added in this alpha release. The Knight Foundation had issued a grant back in September, which funded the development of the new map editor. The new iD editor will replace the OpenStreetMap project's current editor, Potlatch 2. The iD editor, which was developed in association with the author of Potlatch 2, Richard Fairhurst, doesn't require Flash to run. The OpenStreetMap editor is mainly employed to bring in updates to existing maps. Developers can add new roads, buildings and landmarks, based either on a user's recorded GPS traces, or manually, by detecting aerial imagery, which is available for the OpenStreetMap project. So, with an easier map editor, existing developers would be able to draw new contributors to the project, and the map data set will significantly improve.

Meet NanoWatch—a Linux watch-cum-phone

Dumb wrist watches are getting smarter with time. Taiwan-based WiMe has introduced its smart watch, dubbed the NanoWatch, which includes support for voice calls. This means, you can make voice calls from your watch and not just talk to your buddies. You can even listen to music as it includes a Yamaha music chip. Priced at US$ 99, the NanoWatch runs on embedded Linux and sports a 3.9-cm (1.54-inch) resistive touch LCD with a 240x240 pixel resolution. The NanoWatch measures 51.6 mm x 38 mm x 10.2 mm in size and comes with 256 MB ROM, a 4 GB internal microSD card, and a SIM card slot WiMe supplies a headset, a wristband, a micro USB cable and a clipper along with its NanoWatch. You can either wear the watch or can hang it on your neck and even clip the watch to your shirt.

Enjoy Windows apps on Android!

Here's news for techies with Android gadgets who wish to have a Windows OS experience. You can now run Windows apps on Android-based smartphones and tablets. Wine for Linux is soon going to establish itself on mobile devices and will be dubbed as Wine for Android. If you are new to Wine, here is a brief introduction. Wine is open source software, which allows Windows-based applications to run on UNIX-based operating systems. To be more precise, its compatibility layer allows Windows applications to run on POSIX-compliant operating systems like Linux, Mac OSX and BSD. Wine functions differently; instead of simulating internal Windows logic like a virtual machine or emulator, the open source software translates Windows API calls into POSIX calls on the go, thus offering better performance.


OSFYClassifieds Classifieds for Linux & Open Source IT Training Institutes WESTERN REGION

SOUTHERN REGION

Linux Training & Certification Courses Offered: RHCSA, RHCE, RHCVA, RHCSS, NCLA, NCLP, Linux Basics, Shell Scripting, (Coming soon) MySQL

*astTECS Academy Courses Offered: Basic Asterisk Course, Advanced Asterisk Course, Free PBX Course, Vici Dial Administration Course

Address (HQ): 104B Instant Plaza, Behind Nagrik Stores, Near Ashok Cinema, Thane Station West - 400601, Maharashtra, India Contact Person: Ms. Swati Farde Contact No.: +91-22-25379116/ +91-9869502832 Email: mail@ltcert.com Website: www.ltcert.com

NORTHERN REGION GRRASLinuxTrainingandDevelopmentCenter Courses Offered: RHCE,RHCSS,RHCVA, CCNA,PHP,ShellScripting(onlinetraining isalsoavailable) Address (HQ): GRRASLinuxTrainingand DevelopmentCenter,219,HimmatNagar, BehindKiranSweets,GopalpuraTurn, TonkRoad,Jaipur,Rajasthan,India Contact Person: Mr.AkhileshJain Contact No.: +91-141-3136868/ +91-9983340133,9785598711,9887789124 Email: info@grras.com Branch(es): Nagpur,Pune Website(s): www.grras.org,www.grras.com Network NUTS Courses Offered: RHCE, RHCVA, RHCSS, RHCA, CCNA, Linux Clustering, VMware Vsphere ICM Address (H.Q.): A-184, Sukhdev Market, Bhism Pitamaha Road, Kotla Mubarakpur, New Delhi. Contact Person: Ms.Shivani Sharma Contact No.: +91-9310024501, 91-11-46526980/81/82 Email: info@networknuts.net Branch(es): Preet Vihar (Ms.Kavita Kashyap [M:+91-9310024502]) Website(s): www.networknuts.net

Address (HQ): 1176, 12th B Main, HAL 2nd Stage, Indiranagar, Bangalore - 560008, India Contact Person: Lt. Col. Shaju N. T. Contact No.: +91-9611192237 Email: info@asterisk-training.com Website: www.asttecs.com, www.asterisk-training.com Advantage Pro Courses Offered: RHCSS, RHCVA, RHCE, PHP, Perl, Python, Ruby, Ajax, A prominent player in Open Source Technology Address (HQ): 1 & 2 , 4th Floor, Jhaver Plaza, 1A Nungambakkam High Road, Chennai - 600 034, India Contact Person: Ms. Rema Contact No.: +91-9840982185 Email: enquiry@vectratech.in Website(s): www.vectratech.in Duestor Technologies. Courses Offered: Solaris, AIX, RHEL, HP UX, SAN Administration(Netapp, EMC, HDS, HP), Virtualisation(VMWare, Citrix, OVM),Cloud Computing, Enterprise Middleware. Address (H.Q.): 2-88, 1st floor, Sai Nagar Colony, Chaitanyapuri, Hyderabad - 060 Contact Person: Mr. Amit Contact Number(s): +91-9030450039, +91-9030450397. E-mail id(s): info@duestor.com Websit(es): www.duestor.com

IPSR Solutions Ltd. Courses Offered: RHCE, RHCVA, RHCSS, RHCDS, RHCA, Produced Highest number of Red Hat professionals in the world Address (HQ): Merchant's Association Building, M.L. Road, Kottayam - 686001, Kerala, India

Contact Person: Benila Mendus Contact No.: +91-9447294635 Email: training@carnaticindia.com Branch(es): Kochi, Kozhikode, Thrissur, Trivandrum Website: www.ipsr.org Linux Learning Centre Courses Offered: Linux OS Admin & Security Courses for Migration, Courses for Developers, RHCE, RHCVA, RHCSS, NCLP Address (HQ): 635, 6th Main Road, Hanumanthnagar, Bangalore - 560 019, India Contact Person: Mr. Ramesh Kumar Contact No.: +91-80-22428538, 26780762, 65680048 / +91-9845057731, 9449857731 Email: info@linuxlearningcentre.com Branch(es): Bangalore Website: www.linuxlearningcentre.com Veda Solutions Courses Offered: Linux Programming and Device Drivers, Linux Debugging Expert, Adv. C Programming Address (HQ): 301, Prashanthi Ram Towers, Sarathi Studio Lane, Ameerpet, Hyderabad - 500 073, India Contact Person: Mr. Sajith Contact No.: +91-40-66100265 / +91-9885808505 Email: info@techveda.org Website: www.techveda.org

Eastern Region Academy of Engineering and Management (AEM) Courses Offered: RHCE, RHCVA, RHCSS, Clustering & Storage, Advanced Linux, Shell Scripting, CCNA, MCITP, A+, N+ Address (HQ): North Kolkata, 2/80 Dumdum Road, Near Dumdum Metro Station, 1st & 2nd Floor, Kolkata - 700074 Contact Person: Mr. Tuhin Sinha Contact No.: +91-9830075018, 9830051236 Email: sinhatuhin1@gmail.com Branch(es): North & South Kolkata Website: www.aemk.org


Innovation

Many Good Things, With An Open Twist

Gone are the days when ‘open source’ was a concept that applied mainly to the arts and software. Today, open source fires innovation in many things, from gadgets and cars to prosthetic limbs and advanced military vehicles. Every month, in this section, we take a peek at the open source aspects of some interesting devices, applications, tools, etc.

Truly the car of the future

Visteon Corporation has developed the e-Bee, a concept car based on the Nissan Leaf. It has all the automotive electronics you would like to see in your future car – and if Visteon’s estimate is right, your dream might come true by 2020. The e-Bee has everything from entertainment and mobility solutions to safety and comfort. It is filled with loads of technology, including a personalised humanmachine interface (HMI), touch-screen instrument panels that give information on vehicle controls and social media connections, a head-down projected main display in front of the driver, a rear view with 360-degree visibility and augmented reality features, techagnostic wireless charging, near-field communications (NFC) for a personal link between user and vehicle, climate control system, cloud connectivity and car-to-car communications to improve driver information about collisions, hazardous roads, curve speed warnings and traffic flow, and much more.

cloud for up to 60 students. It facilitates what Marvell calls Classroom 3.0, by enabling the delivery of educational content and applications via a range of mobile devices including smart phones and tablets. The device is powered by Marvell's high-performance, low-power ARMADA 300 series system-on-achip (SoC) and the company’s industry leading Avastar 88W8764 wireless chip. Network connectivity is through Gigabit Ethernet, and peripheral devices can be connected using USB 2.0 or Wi-Fi. The open twist: The SMILE Plug runs on a completely open source platform, which makes it easy to develop or port any additional learning applications. It is based on Arch Linux for ARM, NODE.js, and Stanford’s Mobile Inquiry-Based Learning Environment (SMILE) and software development kit (SDK). Other open components include the Node Package Manager, the Plugmin administration API and UI (that runs on Android-based client devices) and the SMILE Junction Server Administration Client.

An open source prosthetic hand The open twist: e-Bee’s extremely advanced audio, video and information platform is based on open technology, and is designed to be upgraded automatically throughout the car’s lifetime. Using open architecture and open source software that meet GENIVI standards, this solution can operate as both the HMI and Media-Oriented Systems Transport (MOST) master and provide up to four independent instances of HMI. The system integrates a wide range of functions into a single scalable module while providing varied connectivity features from Bluetooth and Wi-Fi to Internet connectivity, remote HMI configuration, and software and feature updates. The open software solution leverages features developed by several open source software GENIVI members, maximising re-use and robustness, while reducing the engineering costs to develop such complex systems.

Micro-clouds for a ‘connected’ classroom

One of the best devices demonstrated at CES 2013 was Marvell’s SMILE Plug, which is an easy-to-use, low-power cloud computer that claims to turn a normal classroom into a connected, secure and highly-interactive learning environment by setting up a micro28  |  March 2013  |  OPEN SOURCE For You

When Richard Van As of South Africa lost four of his fingers in a sawing accident, he stumbled upon the designs of a prosthetic hand on YouTube. Together, Van As and the original developer Ivan Owen from Washington perfected the designs to suit Van As. Soon, they decided to make this a worldwide campaign to help those who needed prosthetic hands, and uploaded the designs of their body-powered device in the public domain. They continue to work on the designs, and welcome donations, suggestions and improvements. They also received two 3D printers as a donation from Makerbot, which allows them to synthesise their designs. In January, they used these designs to develop a 3D-printed prosthetic hand, which they called Robohand, for a South African five-year old boy called Liam, who was born without fingers on his right hand. The Robohand suits Liam quite well, and he is now able to play, take care of his personal needs and attend school— where he shows off his mechanical fingers! The open twist: Robohand is a typical example of lowtech mechanics, fast-prototyping and the power of open source. It is made of 16 3D-printed pieces and 28 common, off-theshelf items like nylon cord, nuts, bolts and rubber thimbles. The prosthetic hand is controlled by a system that reacts to the


Innovation

movements of the arm. Apparently, Van As and Owen do not seek any profits from their design—they just want to get enough funds to create prosthetic fingers for whoever needs them, which is why they decided to publish the information in the public domain. The original designs are available at http://chaincrafts.blogspot. in/2012/08/finger-prosthesis-design-details.html, and Liam’s hand design is available at http://www.thingiverse.com/thing:44150. The designs will soon be made available in more detailed formats. By publishing these designs in a public forum, they now fall under the concept of ‘prior art’ (http://en.wikipedia.org/wiki/ Prior_art). This means that the developers have given away their right to patent the design, while also ensuring that others cannot patent it, thus keeping it free and public.

New powder-based 3D printing technology

Alex Budding, a researcher at the University of Twente, Singapore, has developed a new rapid-prototyping technology called Pwdr, a powder-based technology that can be extended to enable multi-colour 3D printing. Pwdr is made entirely with off-the-shelf components. The chassis, tool head and electronics can be purchased for less than €1000 and assembled within a few hours using Budding’s designs. Instead of using layers of melted plastic, Pwdr uses an HP inkjet cartridge. It deposits a liquid binder, mixed with ink, onto a layer of white gypsum power. Then a roller drags a thin layer of powder across the surface. The process is repeated till the whole object is formed, layer over layer. Then, the object has to be removed from the printer, dusted off and dipped in clear glue that helps solidify it.

The open twist: Pwdr has a maximum build size of 125mm x 125mm x 125mm, a minimum vertical step size of 50 microns, and speed of around 1 minute per layer. It has a pretty decent print

resolution of 96 DPI. While there are quite a few open source printer designs already available on the Web, none are powder-based. Budding felt that powder-based printers have a specific application in the field of ceramic materials. His design and code have been open-sourced, and are available on his Github page (http://pwdr. github.com/). While the current design only prints in one colour, the technology could be used to develop a full-colour powder-based printer, thanks to the open design. You could also try to replace the inkjet with a laser, turning the system into a selective laser sintering (SLS) tool. There is also scope to improve the inkjet head, find some way to dispose of the excess powder, or enhance the user-interface. In one of his articles, however, writer Joseph Flaherty issues a word of warning to entrepreneurial readers: “Budding claims that the core patents on this technology expired in 2010, but 3D Systems, ZCorp’s parent company, has recently flexed its legal muscles to defend other disputed patents, so perhaps you should consult a patent attorney before putting a model on Kickstarter.”

Design a tank with open source META toolkit

The USA’s Defense Advanced Research Projects Agency (DARPA) has developed open source software called META that enables anyone to become a tank engineer. The tool will be released shortly, and apparently the framework can achieve the design, manufacture, integration and verification of complex ground vehicles 5X faster than the conventional design-buildtest approach. DARPA has also launched a series of contests, the FANG Design Challenges, which encourage engineers to use the toolset to develop vehicles such as an amphibious tank. The details are available on http://www.vehicleforge.org/. The VehicleFORGE website will allow social collaboration around open source vehicle design to compete in the FANG Design Challenges. The open twist: META is completely open source. It is not based on any one particular approach, metric, technique or tool. The goal of META is to develop model-based design methods for cyber-physical systems that are extremely complex and heterogeneous. It features a structured design flow employing hierarchical abstraction and model-based composition of electromechanical and software components. It further optimises system design, and uses probabilistic formal methods for the system verification, thereby dramatically reducing the need for expensive real-world testing and design iteration. DARPA also aims to develop a component and manufacturing model library for a given airborne or ground vehicle systems domain through extensive characterisation of its features, interactions and properties, right down to the numbered part level. The library will also include context models to reflect various operational environments, and develop a verification flow that generates probabilistic ‘certificates of correctness’ for the particular cyberphysical system based on stochastic formal methods.

By: Janani Gopalakrishnan Vikram The author is a technically-qualified freelance writer, editor and hands-on mom based in Chennai.

OPEN SOURCE For You | March 2013  |  29


Developers

Overview

Develop Android Apps with Ease This article deals with everything related to developing applications for Android. Starting from the basic Android architecture and design philosophy, to helping you get acquainted with the technical stuff before you can develop your app.

M

ost of us already have an Android device, or have at least experienced the Android UI. Android smartphones and tablets are the devices everyone now yearns for; so what causes such a frenzy over Android? I believe it is a combination of the power of Android apps and the developer ecosystem. The ease with which developers can develop and implement Android apps and monetise them is phenomenal, and it is time people interested in this technology learn how to get started with Android app development. 30  |  March 2013 | OPEN SOURCE FOR YOU

Why learn Android

As many of you would already know, Android is an open source, Linux-based OS optimised for use on handheld devices. Although Android started with mobile phones and moved on to tablets, many new consumer electronics devices have been developed based on Android; these include cameras, set-top boxes, and even laptops. Since the devices supporting Android are increasing, so are the opportunities to develop more and more new and innovative apps for them. With Google now allowing developers to charge for their apps in Indian rupees,


Overview there could not be a better time to learn Android.

Android architecture

Android is developed on a layered architecture, with libraries and drivers forming the lower abstraction layers, and the framework, applications, etc, forming the top layers. Each layer provides the necessary services to the layers above and below them. This layered architecture ensures that there are no ambiguities, and the app developer has access to all the APIs. Applications Application Framework Libraries Android Runtime Linux Kernel

The Android app

Let's cover some basics regarding app development, so you get an idea about how it works and can plan to develop your app. Android apps are developed in Java, so you should be clear about Java and object-oriented programming concepts (if not, at least the concepts of classes and objects should be known). The Eclipse IDE for Android development can easily be downloaded from the Android website. This download includes the ADT (the Android Development Tools) packaged with the IDE. If you already have Eclipse, then you can download only the ADT, and install it as a plug-in for Eclipse. ADT makes sure you have all the latest packages and libraries required for Android apps, and the latest Android image for emulation. The Eclipse IDE creates the file organisation for your app. After the app is developed, all the code, resources, and everything that is part of your app should be archived together to form a .apk (Android package) file. This is the file that is installed on the Android device. Eclipse does the archiving part also, so that you can focus on the app development. During or after app development, the IDE also lets you run your app on a real Android device (if you have any) via a USB connection, or a virtual Android device. With this, you can test and debug your app very easily. The manifest file, an XML file, is a major component of an Android app. First, it allows you to declare the permissions the app requires. The user will be prompted with all the

Developers

requested permissions during the app installation. Besides permissions, the components of the app, the minimum API level required, the hardware and software features used, and the API libraries that the application should be linked with— all these must be declared in the manifest file. An Android app can have four types of components. It is important to understand each component type, and how it is useful, so let's briefly cover each. a. Activity: This represents an activity done by the user in your app. For example, in a camera app, the camera viewfinder screen and the image browser screen are separate activities. An activity of your app can be invoked by other apps also, if they have the permission, and vice-versa, while the users feel as if the activity is part of the app they are using. Such architecture allows for better code and functional usage. b. Services: These run in the background while the user continues to interact with the app in the foreground. They are used for cases where you need to fetch data, record a sound or play music in the background. As you would have guessed, a service doesn’t provide a user interface; at most, there can be a notification for completion of the service. c. Content provider: This is the component that provides data to the app, i.e., any application can query or modify a database through the content provider. So, when you have proper permissions, you can use the content provider to read or modify the user data. d. Broadcast receivers: The system interacts with the apps via broadcasts, if required. For example, when the battery is low, or the screen gets turned off, the system issues a broadcast to all applications. The broadcast receivers respond to the broadcasts, and initiate the corresponding service. Now that we’ve been through the different aspects and the basic information about Android app development, I hope you are excited about getting started on developing a real Android app, which I will begin with in the next article. Till then, get ready with ideas for what your app will do! By: Nitish Kumar Tiwari The author is based in Bengaluru, India, and works as a software developer for a FOSS-based firm. In his free time, he likes to dabble with open source software and share his experiences. Other interests include movies and travelling. Contact him at Nitish.tiwari@techocube.in.

EXCELLENT EMAIL INFRASTRUCTURE SOLUTIONS WITH UNMATCHED SERVICE SUPPORT! TechnoMail - Enterprise Email Server Anti SPAM, Anti Virus, Email Content Filtering Firewall, Internet Access Control Content Filtering, Site Blocking Bandwidth Management System Managed Email Hosting Solutions

1, Vikas Permises, 11 Bank Street, Fort Mumbai, India-400 001, Mobile: 09167399917. Email: info@technoinfotech.com

OPEN SOURCE FOR YOU | March 2013  |  31


Developers

Let's Try

This article aims to provide a clear and concise discussion about the basics of futexes, and how they could be used to implement user-space synchronisation mechanisms on Linux.

S

o what are futexes? They are a kernel mechanism (in the form of a system call), using which fast userspace synchronisation can be implemented. The kernel interface for futexes looks like what is shown below: int futex(int *uaddr, int op, int val, const struct timespec *timeout, int *uaddr2, int val3);

The second param, op, can have several values, of which the following two are relevant for this discussion: FUTEX_WAIT: The kernel checks if the value at uaddr is the same as val; if so, it then blocks the calling thread/ process. If not, it then returns with EWOULDBLOCK. The last two parameters are ignored for this op, and the timeout parameter is not relevant, at least for now. FUTEX_WAKE: The kernel wakes up at most val processes waiting on this futex. The last three parameters are ignored for this operation. So why do we need futexes? Take a look at the traditional user-space synchronisation mechanisms: Spin lock involves spinning on a variable in user space if the lock is not available. No context switch to kernel space is necessary. Spin locks are great if the size of the critical section is known to be small, or if there is no alternate work to be executed after blocking the thread. A lot of research has highlighted the limitations of spin locks—not scalable with multi-cores, fairness issues, etc. 32  |  March 2013 | OPEN SOURCE FOR YOU

Semaphores involve making a system call each time, be it contended or uncontended. Hence, they are slower. Thin locks initially try user-level locking (using atomics), similar to spin locks. If it fails, they inflate the lock and only try OS-level locking (similar to semaphores). But inflating happens only once, the first time a contention is seen. Then on, they stay inflated. Again, there's system call overhead, once the lock is inflated. In order to address some of these issues, futexes were added to the Linux kernel to enable library developers to implement a fast user-space synchronisation mechanism. How is this done? Note: This discussion is based on the paper ‘Futexes are Tricky’ by Ulrich Drepper. Using the above futex system call interface, fast userspace synchronisation mechanisms can be implemented. 1) The condition wait-signal mechanism: This is typically used in producer-consumer problems, similar to what pthread_cond_wait and pthread_cond_signal provide. The following code snippet shows how this may be implemented: class event { public: event () : val (0) { } void ev_signal () {


Let's Try ++val; futex_wake (&val, INT_MAX); } void ev_wait () { futex_wait (&val, val); } private: int val; };

Here, the consumer threads call ev_wait() and pass in the current value of val (which is the same as what is stored at &val); hence, it is blocked. Note the semantics of the futex_wait() call above—although the interface shown here is slightly different. The producer thread calls ev_signal(), which increments the value of val and calls futex_wake() to wake up all the waiting threads (all since INT_MAX is passed as val; again, a different interface is shown here, for the sake of discussion). Note here that incrementing val before calling futex_ wake() is not really necessary, but here it is done to avoid a race condition. Let us suppose a new consumer thread had read the old value of val and was context-switched before calling futex_wait(). Now, after the producer called ev_ signal(), if the futex_wait() is invoked in the new consumer, it would not block, since the value of val is not the same as what it had originally read. 2) Implementing mutual exclusion (mutexes): The following code illustrates one simple, trivial way to implement mutual exclusion using the above futex interface: class mutex { public: mutex () : val (0) { } void lock () { int c; while ((c = atomic_inc (val)) != 0) futex_wait (&val, c + 1); } void unlock () { val = 0; futex_wake (&val, 1); } private: int val; };

Here, a zero value for val represents an unlocked mutex. Any other value represents a locked one. It is easy to see how this provides mutual exclusion. When two different threads call lock() at the same time, only one of them finds that the old value was non-zero, and only that thread is put to sleep. Hence, only one thread enters the

Developers

critical section. In unlock(), only one thread is woken up at a time. This is kind of an optimisation, which works just fine with respect to correctness. Although this seems to work, it has several problems. The correctness problem (1): Consider the following scenario. The lock is taken by thread T1, and T2 and T3 execute lock() almost at the same time. Let us suppose the lock() code gets executed in the following manner: Initially, assume val is 1; T2 T3 lock() atomic_inc (val) //now val=2, c=1

lock()

atomic_inc (val) //val=3, c=2 futex_wait (&val, c + 1); //value(val)=3 atomic_inc (val) //now val=4, c=3 futex_wait (&val, c + 1); //value(val)=4

In the above sequence, both futex_wait calls fail, since the actual value of val (3 and 4 as shown in the code) is not the same as what is being passed as second arg (c+1 = 2 and 3 respectively). This sequence may repeat forever, making the program incorrect. The correctness problem (2): In case of interrupts, a single thread may keep getting interrupted exactly when it calls futex_wait(). This system call returns whenever an interrupt occurs. Hence, a single thread may keep incrementing val until it overflows and becomes 0. A performance-related problem: The futex_wake() call can be avoided in unlock() in the uncontended case.

Better mutex implementation

Consider the following revised implementation, which fixes these issues: class mutex2 { public: mutex () : val (0) { } void lock () { int c; if ((c = cmpxchg (val, 0, 1)) != 0) do { if (c == 2 || cmpxchg (val, 1, 2) != 0) futex_wait (&val, 2); } while ((c = cmpxchg (val, 0, 2)) != 0); /// Interesting } void unlock () { if (atomic_dec (val) != 1) { val = 0; futex_wake (&val, 1); OPEN SOURCE FOR YOU | March 2013  |  33


Developers

Let's Try Kernel support for futexes

} } private: int val; };

Here, we use 3 states instead of 2: 0 – unlocked, 1 – locked + no contention, and 2 – locked + contention. Also, this code uses cmpxchg(), which also returns the old value. If the lock was free, the thread simply gets the lock, sets it to 1 and returns. If the lock was already taken, there are two cases: a) In the uncontended case, nobody else is contesting for the lock; hence, its value is 1. We indicate that there's a waiting thread by setting the value to 2. b) In the contended case, the value is already 2. The check (c==2) succeeds and the thread simply blocks. But if the futex_wait() fails (because of unlock() code waking it up, or an interrupt), then it would have to try to set the value of lock again. But here (in the while() statement), we try to set it from 0 to 2 directly, since we don't know at this point if we are the only ones who are locking. There may be many waiting. Now, in the lock code there's no question of overflow, since the highest value it reaches is 2. This fixes both correctness problems 1) and 2) discussed above. In the unlock code, check that the state is contended, and only then call futex_wake(). This fixes the performance problem discussed earlier.

At the kernel level, each futex has a unique ID, which is the struct page pointer and the offset within the page. This way, even though the futex variable may have different virtual addresses across processes, the physical address is the same, hence providing synchronisation. The reference count of the page is incremented, so that it is not swapped out of memory even when the process is sleeping. The futex structure on which a process is sleeping is placed on the kernel stack of the process. A hash table maps the futex ID (uaddr param, above) to per-thread/per-process futex_q structs. When futex_wait() is called by a thread, a new futex_q object is created for it and added to the appropriate hash table entry. When futex_wake() is called, the same is used to wake up the sleeping process. Do refer to the links below about futex implementation at the kernel level, for more details. References [0] http://www.cis.temple.edu/~giorgio/cis307/readings/futex0.pdf [1] http://www.cis.temple.edu/~giorgio/cis307/readings/futex.pdf [2] http://locklessinc.com/articles/mutex_cv_futex/ [3] http://lwn.net/Articles/360699/ [4] http://lwn.net/Articles/267968/

By: Chandan Apsangi The author is currently doing a Masters in Computer Science at NC State University in the US, with a focus on multi-core operating systems and optimisations.

You can mail us at osfyedit@efyindia.com. You can send this form to ‘The Editor’ - D-87/1, Okhla Industrial Area, Phase-1, New Delhi-20. Phone No. 011-26810601/02/03, Fax: 011-26817563

34  |  March 2013 | OPEN SOURCE FOR YOU


How To

Developers

Android’s favourable licence, established application ecosystem and well-recognised user experience has made it the preferred platform for any modern embedded system. The pluggable architecture enables integration with a variety of desirable software and hardware components with low coupling. At the same time, support for a range of hardware platforms enables the designing of cost-effective low-end devices like digital watches, as well as sophisticated high-end devices like in-vehicle infotainment systems and home automation systems. This article covers the crucial steps of analysing an enterprise’s needs, understanding SoCs, and deciding which device addresses the need while fitting the budget.

T

he first step in creating a custom device is to have a clear picture of what the device is required to do, and what the company’s budget is. Depending on these two factors, the exact hardware requirements can be figured out. For instance, if the device is required for the stock management staff of a grocery centre, then the bar-code scanning capability would be required and it may be appropriate to choose a small form-factor smartphone for the task, with Android version 2.2 or above. If the device is to be designed for sales people to upload customer data on the go, then Wi-Fi connectivity would be desirable, and a tablet form-factor with Android 2.3 or above would work well for such a requirement. In order to understand the complete workflow of device creation, let us consider the following target system as a sample scenario: The AGROSTAR company deals in a wide range of agriculture products covering a range of requirements from crop protection to animal health. AGROSTAR

requires a custom device solution for its field sales team that visits client sites at various locations in India. The company has a budget limit of Rs 5000 per device, and would need the solution deployed for 3000+ field workers. The primary use cases are shown in the following diagram on the next page. Looking at the above system requirements and the users’ need to show presentations and product details to prospective customers, a tablet form factor, with Wi-Fi capability and Android 2.3+ seems suitable for the target requirement.

Identify device hardware

Once the system requirements are identified, the second step is to decide on hardware requirements. Though creating a custom device may be useful for very specific use cases and bulk production, enterprises prefer successful devices that are already in use in the market. So let us learn more about the device hardware and the hardware profiles used by popular OPEN SOURCE FOR YOU | March 2013  |  35


Developers

How To

Manage Schedule

√userv √userv √userv

Submit customer details

√userv √userv

Synchronise product documentation

Sales Personnel View product documentation

agrostar Sales Personnel cases

Submit visit & location details

Android devices in the market today.

An overview of device hardware

The device hardware largely consists of a System-on-Chip (SoC) and miscellaneous accessories. A SoC typically consists of the following components: CPU: In the case of Android, most processors on the SoCs are based on ARM technology. Memory: Memory is required to perform the various tasks smartphones and tablets are capable of, and therefore SoCs come with various memory architectures on board. GPU: The graphics processing unit is responsible for handling complex 3D games on the smartphone or tablets. GeForce, Adreno, ARM Mali and Power VR are some of the popular GPU models available in the market. Northbridge: This component handles communications between the CPU and other components of the SoC, including the Southbridge. Southbridge: This is a second chipset, usually found on computers, that handles various I/O functions. In some cases, a Southbridge can be found on SoCs too. Cellular radios: Some SoCs also come with certain modems on board that are needed by mobile operators. Other radios: Some SoCs may also have other components responsible for other types of connectivity, including Wi-Fi, GPS/GLONASS or Bluetooth. Again, the Snapdragon S4 is a good example. Other circuitry Some of the well-recognised SoCs in the market are described below: NVIDIA Tegra 3: The Tegra 3 comes with a quad-core CPU, and is currently employed by various Android devices, including, but not limited to, the Asus Eee Transformer Pad, HTC One X (international version), the Asus Transformer Pad 300, the LG Optimus 4X HD and others. Qualcomm Snapdragon S4: Snapdragon S4 has a dualcore processor that’s similar to the ARM Cortex-A15 CPU. It also offers HD video recording and playing support, integrated Adreno GPU capabilities, and packs in a 4G LTE modem, which makes it a preferred choice by many manufacturers planning to launch devices in the US. It also 36  |  March 2013 | OPEN SOURCE FOR YOU

handles Wi-Fi, GPS/GLONASS, and Bluetooth on most devices. Some Android devices that use this SoC include the HTC One S, Asus Transformer Pad Infinity, NorthAmerican HTC One X, HTC EVO 4G LTE, Sony Xperia S, North American Samsung Galaxy S3, and others. Samsung Exynos 4 Quad: Samsung has its own SoC platform, the ARM based Exynos family. The latest addition, the Exynos 4 Quad, packs a 1.4 GHz quadcore ARM Cortex-A9 CPU and the ARM Mali-400 MP4 quad-core GPU. The processor supports 3D gaming, fast multi-tasking, and HD video recording and playback. The Exynos 4 Quad is used in the Galaxy S3 (international version) and in the Meizu MX Quad. Previous Exynos generations can be found in the Galaxy S2, Galaxy Note, Galaxy Tab 7.7, Galaxy Tab 7.0 Plus, Galaxy S, Droid Charge, Exibit 4G, Infuse 4G, and also in non-Samsung devices such as the Meizu MX and Meizu M9. Texas Instruments OMAP 4: The latest TI OMAP SoCs family is the fourth generation of OMAPs, or OMAP 4, which has a dual-core ARM Cortex-A9 45nm-based architecture. These offer PowerVR graphics. Some Android devices that pack TI OMAP 4 SoCs include Motorola Atrix 2, Motorola Droid 3, Motorola Droid Bionic, Motorola Droid RAZR, Motorola Xyboard, some Samsung Galaxy S2 models, Amazon’s Kindle Fire, Samsung Galaxy Tab 2 7.0, Samsung Galaxy Tab 2 10.1, Samsung Galaxy Nexus, LG Optimus 3D and LG Optimus Max. ST-Ericsson NovaThor: NovaThor SoCs come with a 1 GHz or 1.2 GHz dual-core ARM Cortex-A9 processor, single-core ARM Mali 400 GPUs, and wireless support (GSM/EDGE/HSPA/HSPA+, depending on the model used). Some devices that rely on this SoC include the Sony Xperia P, Sony Xperia U, Sony Xperia Sola, Samsung Galaxy Ace 2, Samsung Galaxy Beam and the HTC Sensation for China. Rockchip: Rockchip is a series of SoC integrated circuits manufactured by the Fuzhou Rockchip Electronics Company. These integrated circuits are mainly for embedded systems applications in mobile entertainment devices such as smartphones, tablets, e-book readers, set-top boxes, media players, and personal video and MP3 players. AllWinner A1X: The AllWinner A1X, known under Linux as sunxi, is a family of SoC devices designed by AllWinner. Currently, the family consists of the A13 and the A10. They incorporate the ARM Cortex-A8 as the main processor, and the Mali 400 as the GPU. It is known for its ability to boot from an SD card, in addition to the Android OS usually installed on the flash memory of the device. A10 (sun4i) is the current full-featured SoC, whereas A13 (sun5i) has lower power consumption, and is a lower-cost version of the A10,


How To which is designed primarily for tablet computers. The A13 does not have HDMI or SATA connections. Intel Medfield (X86): Medfield SoCs are built with 32nm HKMG technology, and are based on x86 technology. They offer OEMs a 1.6 – 2 GHz singlecore processor and PowerVR’s SGX540 GPU. Some devices that use the Intel Medfield SoC are the Orange San Diego (Santa Clara), the Lenovo K800 and the Lava Xolo X900.

Deciding device configuration

All the next generation Android tablets and smartphones available pack in one of the SoCs mentioned above. Sure, every SoC manufacturer will promote its own brand with terms like, ‘power efficiency’, ‘high performance’, ‘3D graphics’, ‘full HD video’, etc, but all these competing platforms will offer an overall enjoyable user experience, with few differences between them. The fact is that while choosing a device, you should not only consider the SoC's capabilities, but also other factors like display technology, wireless connectivity, camera performance and storage. Whatever be the current system requirements, the hardware and Android version should always be chosen keeping in view the future requirements of the target system. Let us return to the AGROSTAR company’s

Developers

requirements. On examining the complete system requirements, we concluded that we would need a good hardware configuration that has high-definition audio and video capabilities, as well as Bluetooth and Wi-Fi for communication. On exploring the current crop of SoCs and the tablet market, an existing tablet model supporting Android version 4.1 with an AllWinner SoC was found suitable for the prospect's requirements and budget. To conclude, the existing models in the market might suit an enterprise’s need, and in most cases, will prove to be an economical option. However, there may be specific needs like a fingerprint scanner for an attendance terminal, or a card reader for a retail billing kiosk. In such cases, there may be a need for a custom device design to ensure in-built support for the extra accessories. Integrating existing device models with third-party hardware may be considered as an alternative, depending on the deployment intricacies and budget restrictions. By: Pooja Maheshwari The author is a technical architect at Impetus Technologies. She has about 12 years of IT experience, with wide exposure in the design and development of enterprise mobility solutions, mobile device management solutions and Android-based custom device solutions for enterprises. She is currently involved in R&D and applicability of Embedded Android for enterprises in various segments.

OPEN SOURCE FOR YOU | March 2013  |  37




Developers

Let's Try

Have You Powered Your Application with Memcached? Developers know that in computer/network technologies, the speed of an application is really important. Here, we are going to demonstrate how fast a memcached-powered application will perform.

T

he article published in the March 2012 edition of OSFY (‘Speed up Your Cloud with Memcached’) covered the concepts related to memcached. In this article, I aim to demonstrate just how much performance improves if you use a memcached layer between your application and database. For example, consider a Web application. Any website that is served up ‘dynamically’ probably has some static components throughout the life of the page. Loading such information each time through a database query is unacceptable. Let us consider a website that has a very huge list of names in a database, which does not change frequently—and this list has more than 3,000,000 rows of data. Now, you want to display some of the names, which match some user criteria (say, a user clicks on a button). What happens if that page gets reasonably good traffic, and many users click that button to fetch the data? The database will ‘cry’, right? In this case, every click made by each user will make a direct call to the database, causing a really unacceptable overhead to the database. Here, the importance of caching comes into the picture, and as a caching mechanism, memcached will shine.

40  |  March 2013 | OPEN SOURCE FOR YOU

Given below are the steps to set up an environment for demonstrating the speed of a memcached-powered application.

Step 1: Setting up the database

Create a database called ips in MySQL, and a table called ips_class inside it. Then generate a set of 33554431 IPs using bash expansion: echo {192..193}.{0..255}.{0..255}.{0..255}

Insert all these IPs into the table ips_class using LOAD DATA INFILE [see http://dev.mysql.com/doc/refman/5.5/en/ load-data.html] mysql> select count(*) from ips_class; +----------+ | count(*) | +----------+ | 33554431 | +----------+ 1 row in set (18.24 sec)


Let's Try Step 2: Setting up memcached

Download the memcached source from http://memcached. org/ and install it. Start memcached on the local system on two ports, using the following commands: memcached -p 11212 & memcached &

I now have two memcached instances, one running on port 11212 and the second on the default port (i.e., 11211). $ telnet 0 11211 Trying 0.0.0.0... Connected to 0. Escape character is '^]'. $ telnet 0 11212 Trying 0.0.0.0... Connected to 0. Escape character is '^]'.

What next? Get the memcached_demo.py script, for which you can use the following command: git clone git@github.com:sukujgrg/mysql_memcached.git

What this script does

This script contacts the local MySQL database and executes two SQL fetch queries (below). On the first execution of the script, it will print the output of the query, which is directly fetched from the database, and will also store that data in a locally running memcache instance. From the next execution onwards, this script will directly fetch data from the memcache. The SQL queries to fetch data in this script are: select * from ips_class where c_class like '192.168.1.25%'; select count(*) from ips_class;

Developers

$ python memcached_demo.py Fetched from DB (Execution time = 17.4954309464 seconds) Total IPs in the DB = 33554431 Fetched from DB (Execution time = 18.8784821033 seconds) All IPs in DB which is matching to the regex 192.168.1.25* = 192.168.1.25 192.168.1.250 192.168.1.251 192.168.1.252 192.168.1.253 192.168.1.254 192.168.1.255

On second execution of the script: $ python memcached_demo.py Cached Result (Execution time = 0.000431060791016 seconds) Total no. of IPs in the DB = 33554431 Cached Result (Execution time = 0.00189614295959 seconds) All IPs in DB which is matching to the regex 192.168.1.25* = 192.168.1.25 192.168.1.250 192.168.1.251 192.168.1.252 192.168.1.253 192.168.1.254 192.168.1.255

You can clearly see the difference between the ‘Execution time’ in both cases. Very impressive, right? Of course, there are many options, including invalidating or expiring the data, in memcached. For more on the topic, delve deeper into the References. References [0] http://www.ibm.com/developerworks/xml/library/osmemcached/index.html [1] http://www.adayinthelifeof.nl/2011/02/06/ memcache-internals/ [2] http://dev.mysql.com/doc/mysql-ha-scalability/en/ ha-memcached-interfaces-python.html [3] http://blog.echolibre.com/2009/11/memcache-andpython-getting-started/

By: Suku The author is an open source fan. Feel free to respond to this article and direct your feedback to sukujgrg@gmail.com.

On first execution of the script:

THE COMPLETE M AGAZINE ON OPEN SOURCE

Your favourite Magazine on Open Source is now on the Web, too.

LinuxForU.com Follow us on Twitter@LinuxForYou

OPEN SOURCE FOR YOU | March 2013  |  41


CODE

SPORT

Sandya Mannarswamy

Over the next few columns, we will take a look at data storage systems, and how they are evolving to cater to the data-centric computing world.

L

ast month, we featured a special edition of ‘CodeSport’, which discussed the evolution of programming languages over the past 10 years, and how they are likely to evolve over the coming 10 years. The article went on to hazard a guess that the ‘Big Data’ explosion would shift the momentum to languages that make data processing simple and efficient, and make programs ‘datacentric’ instead of the ‘code-centric’ perspective. Many of our readers had responded with their own views on how they see computing paradigms evolving over the coming 10 years. Thanks a lot to all our readers for their feedback and thoughts. One of our readers, Ravikrishnan, sent me a pertinent comment, which I want to share: “Thank you for your article on the evolution of programming languages. Indeed, there is a heavy momentum towards processing huge amounts of data using commodity hardware and software. While the basic concepts and algorithms of computer science would continue to hold sway, the sheer scale of the data explosion would require programmers to understand and apply algorithms where data does not fit in main memory. Hence programmers need to start worrying about data latency of secondary storage such as flash SSD/disk storage systems. In a way, the shift towards data-centric computing means more intelligent storage systems, and a need for programmers to understand about state-of-the-art storage systems, where big data is stored, processed and preserved. While this is not a traditional topic covered in ‘CodeSport’, given the importance of data storage in a ‘Big Data’ world, it would be great if ‘CodeSport’ does a deep-dive into state-of-the-art storage systems in a future column.” It was a timely reminder for me. While I have discussed various ‘Big Data’ computing paradigms

42 | March 2013 | OPEN SOURCE FOR YOU

in some of our past columns, I have not covered storage systems at all. So over the next few columns, I am going to discuss storage systems, and how they have evolved over years to cater to the ‘Big Data’ explosion. I will take readers through some of the challenging problems as well as the state-of-the-art research directions in this space.

A storage systems primer

Let us start our journey into storage by understanding some of the basic concepts and terminology. In the traditional view of storage, we all know about the triumvirate of the CPU, memory and disk, where the hard disk (also known as secondary storage) is part of, or directly attached to your computer, and acts as the permanent storage. From now onwards, when I use the term ‘storage’, I actually imply the traditional secondary storage, which acts as the backup to the main memory (which is the primary storage). These include hard disk drives, flash/SSD storage, tape drives, etc. Traditional HDDs are accessed using a variety of protocols such as SCSI, ATA, SATA and SAS. SCSI stands for Small Computer System Interface and is a parallel peripheral interface standard widely used in personal computers for attaching printers and hard-disks. ATA is another interface used for attaching disks; also known as IDE, wherein the controller is integrated into the disk drive itself, ATA is also a parallel interface like SCSI and both have their equivalent serial interfaces namely, Serial SCSI (abbreviated as SAS) and Serial ATA (abbreviated as SATA) which allow a serial stream of data to be transmitted between the PC and the disk drive. Note, however, that in the traditional view of storage, it is part of the compute server, since it is directly attached to the server and is accessed through


Guest Column

CodeSport

it. It is not an independent addressable LAN entity, and is not shared across multiple computers. Typically, this is known as Disk Disk Disk ‘Direct Attached Storage’ (DAS). Access User to the data in secondary storage is through the server to which it is attached; hence, if the server is down due to some failure, the Server 1 data becomes inaccessible. Also, as data storage requirements increase, we need to have greater storage capacity. We produce User Disk Disk Disk 2.5 quintillion bytes of information every day, out of the Web searches we do, the online purchases we make, the mobile calls we make, and the social network presence Server 2 we have (a quintillion is 1000 x 1000 x User 1000 times a billion). Given the volume of Big Data that gets produced, the storage Disk Disk Disk requirements go on increasing exponentially. However, in case of Direct Attached Storage, the number of I/O cards (for example, SCSI cards) that can be connected to a computer Server 3 User is limited. Also, the maximum length of a SCSI cable is 25 M. Given these restrictions, Figure 1: Disks on Server 2 are full the amount of storage that can be realised using the conventional directly attached LAN storage is limited. Also note that DAS results in uneven storage utilisation. If one of the servers has used up all its disk storage and needs further storage, it cannot use any free User storage available in the other servers. This is shown in Figure 1, where disks on Server 2 are full, whereas there is excess disk capacity Server available on Servers 1 and 3. However, it is not possible for Server 2 to use them. User As opposed to the traditional serverStorage Network centric paradigm we have seen above, in a storage-centric view, storage exists as an independent entity, apart from the compute servers. Storage can be addressed Server independently, from multiple servers. A User simple form of a storage network is shown in Figure 2, where we can visualise the SCSI cables of the computers having been replaced with connections to the network storage. Though the storage is an independent entity Server on a network, to the operating system running User on the compute server, it appears as if locally Figure 2: Storage network attached to the compute server. Two popular forms of storage-centric architectures are Network Attached Storage (NAS) and iSCSI (internet SCSI). SANs provide block-level access Storage Area Network (SAN). The latter (SAN) allows to storage, just like traditional locally attached storage. storage entities to exist in a network, which can be accessed In contrast, in the case of Network Attached Storage or from compute servers using either special protocols such NAS, a dedicated storage computer exists as an entity as Fibre-Channel or standard TCP/IP protocols such as on the network, and is accessible from multiple compute

Disk

oPEN SOURCE FOR YOU |March 2013 | 43


CodeSport

Guest Column

servers concurrently. Unlike a SAN, a NAS provides file-level storage semantics to multiple compute servers, appearing as a file server to the operating system running on the compute server. Internally, the NAS file server would access the physical storage at block level to access the actual data, while this is transparent to the OS on the compute server, which is exposed only to file-level operations on the NAS server. Hybrids of SAN and NAS also exist. Since there is no file system concept for SANs, various file protection and access-control mechanisms need to be taken care of in the OS running on the compute server. In case of NAS, file protections and access control can be enforced at the NAS server. The next concept we need to understand in the storage domain is Scale-up Storage vs Scale-out Storage, which we will discuss next month.

Remembering Aaron Swartz

It has been almost two months since the death of Aaron Swartz. Most of us would have read about the enormous outpouring of grief caused by this tragic loss. Aaron Swartz was a programmer first and foremost, and the reason I wanted to mention him in our column was not just because he was a well-known activist who fought for the freedom of information on the Internet, but because he is a sterling example of what differentiates a great programmer from the run of the mill. He had an enormous enthusiasm for building software that solves challenging problems. He was involved in the development of the RSS format, wrote the Web.py framework, and was a technical architect of reddit.com, just to mention a few examples of his work. He had a great

passion for expanding and sharing his knowledge with all developers. Rest in peace, Aaron.

My ‘must-read book’ for this month

This month’s must-read book suggestion comes from one of our readers, Aruna Rajan. She recommends the book ‘Introduction to Information Retrieval’ by Christopher D. Manning, Prabhakar Raghavan and Heinrich Schütze. This book focuses on various information retrieval techniques, including the most popular one of Web search engines. The book is available online at http://nlp.stanford.edu/IR-book/html/htmledition/ irbook.html. Thank you, Aruna, for your suggestion. If you have a favourite programming book/article that you think is a must-read for every programmer, please do send me a note with the book’s name, and a short write-up on why you think it is useful, so I can mention it in the column. This would help many readers who want to improve their coding skills. If you have any favourite programming puzzles that you would like to discuss on this forum, please send them to me, along with your solutions and feedback, at sandyasm_AT_yahoo_ DOT_com. Till we meet again next month, happy programming and here’s wishing you the very best!

By: Sandya Mannarswamy The author is an expert in systems software and is currently in a happy state between jobs. Her interests include compilers, multi-core technologies and software development tools. If you are preparing for systems software interviews, you may find it useful to visit Sandya’s LinkedIn group ‘Computer Science Interview Training India’ at http://www.linkedin.com/ groups?home=&gid=2339182.

OSFY Magazine Attractions During 2013-14 Month

Theme

Featured List

March 2013

Virtualisation

Virtualisation Solution Providers

April 2013

Open source Databases

Certification & Training Solution Providers

May 2013

Netwok monitoring

Mobile Apps

June 2013

Open Source application development

Cloud

July 2013

Open Source on Windows

Web Hosting Providers

August 2013

Open Source Firewall and Network security

E-mail Service Providers

September 2013

Android Special

Gadgets

October 2013

Kernel Special

IT Consultancy

November 2013

Cloud Special

IT Hardware

December 2013

Linux & Open Source Powered Data Storage

Network Storage

January 2014

Open Source for Web development and deployment

Security

February 2014

Top 10 of Everything on Open Source

IT Infrastructure

44 | March 2013 | OPEN SOURCE FOR YOU


Let's Try

Developers

Build Your Own Web Page With QForms QForm is the state-conscious, event-driven object management system for creating Web pages. QForm is the ‘C’ and ‘V’ of the MVC architecture of QCubed. It relieves you from typing HTML code for every single element, and dealing with monotonous and repetitive code for handling user actions.

T

he entire world is moving to the Web. Socket programming is becoming passé for even lowerlevel programs as JavaScript catches on with JSON, while other Web technologies such as Web sockets promise better results in an increasingly distributed world. We have become habituated to using Web services that promise to be reliable. Facebook, Twitter, GMail, and even WordPress and Drupal, all deliver the content so well that we often forget that the Web is a stateless mess. No machine remembers anything about a previous action, primarily because HTTP does not support states.

What is a state anyway?

When I say stateless, I mean to convey that in most cases, when we log into a Web application, the server does not know the state of the application on the client side. Which elements are being displayed, which ones are hidden, and what can be done on the page—the server knows none of this. To make sure that an invalid request does not cause a security breach, and to assure the right response for every request, a number of methods are in use. In most cases, cookies are used to validate a user’s identity and authenticity, and the programmer has to build a system that OPEN SOURCE FOR YOU | March 2013  |  45


Developers

Let's Try

could keep track of what the user does in his browser. This is important to make sure that the server side of the application does not send any invalid or unnecessary data to the client. QCubed, using its QForm library, however, takes a snapshot of the page and saves it on the server side before sending the HTML to the client. This state is used in later requests from the client. This technique improves the application reliability, and reduces the programmer’s work and complexity of design by a very large margin.

What is QForm?

In the previous article, we have already looked at Codegen, which helps build forms, and takes care of the ‘Model’ part of QCubed’s MVC architecture. QForm is the part of QCubed that handles the ‘View’ and ‘Controller’ parts of MVC. QForm is responsible for creation of the page, along with elements (we would call them controls) on the page (text-boxes, buttons, text, etc.) and helps the developer determine the events that will trigger actions, and the way in which those actions are to be handled. Before we go into code, let us first answer an interesting question: “If QForm handles the Web page, why is it named QForm, not QPage?” The reason is, QCubed treats the entire page as a ‘Form’ that submits to itself. This technique makes sure that the client does not have to know the names of other files used in the process, nor their paths, nor their function names—a better level of security, you see! For example, if you allow the user to insert data in newpost.php, while insert_newpost. php handles the values from the form submission and inserts data into the database, then a bug in insert_newpost.php can possibly open a plethora of vulnerabilities! QCubed would normally hide the information about which file handles which request on the server. This technique has another benefit; it helps handle multiple events and actions easily. Now, without further ado, we will delve into the code.

protected $btnSubmit; // Text labels protected $lblMessage, $lblResult; protected function Form_Create() { // Set message at top $this->lblMessage = new QLabel($this); $this->lblMessage->Text = "<strong>Create new Blog Post</strong>"; // Define Title input box $this->txtTitle = new QTextBox($this); // Define Body input box $this->txtBody = new QTextBox($this); // make it a textarea $this->txtBody->TextMode = QTextMode::MultiLine; // Submit Button $this->btnSubmit = new QButton($this); $this->btnSubmit->Text = 'Submit'; $this->btnSubmit->AddAction(new QClickEvent(), new QAjaxAction('btnSubmit_Click')); // Result text $this->lblResult = new QLabel($this); }

In previous articles, we created a small MySQL database to store blog posts and comments. Let us create a Web page that allows us to insert a new blog post in the database.

protected function btnSubmit_Click($strFormId, $strControlId, $strParameter) { // Create new post $objNewPost = new Post(); // Load defaults $objNewPost->Initialize(); // Assign values from the form $objNewPost->Title = $this->txtTitle->Text; $objNewPost->Body = $this->txtBody->Text; // Save $objNewPost->Save(); // Saved. Show the result $this->lblResult->Text = "Post was saved"; // Empty the textboxes $this->txtTitle->Text = ''; $this->txtBody->Text = ''; } }

Code

NewPost::Run('NewPost');

Building the first Web page in QCubed

Create a file named newpost.php in the root directory of your QCubed installation, and put the following code in it: <?php require_once 'qcubed.inc.php'; class NewPost extends QForm { // Declaring elements—Input Boxes protected $txtTitle, $txtBody; // Submit button

46  |  March 2013 | OPEN SOURCE FOR YOU

And in the same directory, create another file named newpost.tpl.php, and put the following in it: <html><head> <title>Create new Blog Post</title> <link rel="stylesheet" type="text/css" href="<?php echo __ CSS_ASSETS__ . "/styles.css" ?>" /> </head><body> <?php $this->RenderBegin(); ?>


Let's Try <p> <?php $this->lblMessage->Render(); ?><br> <strong>Title</strong> <?php $this->txtTitle->Render(); ?> <br> <strong>Body</strong> <?php $this->txtBody->Render(); ?> <br> <?php $this->lblResult->Render(); ?> <br> <?php $this->btnSubmit->Render(); ?> <br> </p> <?php $this->RenderEnd();?> </body></html>

Developers

l oc al h ost / l f y / n ewp ost . p h p <strong>Create New Blog Post</strong> Title

Body Submit

Then visit the newpost.php file in your browser; the output should look like Figure 1. Before you think that the strong HTML tag at the top is because of an error somewhere, let me tell you that such output is expected; we will know why shortly.

Understanding the code

QForm separates the presentation layer and program logic into two different files. The newpost.php file contains the logic of the page (controller), while the newpost.tpl.php governs the layout (view). We begin with the logic. The first line of the controller file includes the qcubed. inc.php file from the root directory of your QCubed installation. This readies the framework capabilities to be used throughout the file. Next, we define a class NewPost, which is derived from the QForm class. Before we proceed with creating the HTML controls (such as textboxes, buttons, etc), we define them as class members. If these variables are not defined as class members but as local variables inside the Form_Create function, you would not be able to render them, much less handle any actions on them. This is because the layout is created by the view file, which has no access to variables in the Form_Create function but can access class members. The initial behaviour and content is determined by the Form_Create function. In this function, we define the controls (HTML elements). For example, when we do: $this->lblMessage = new QLabel($this);

Here we actually tell QCubed to make an lblMessage class member variable of type QLabel, with the current QForm as the parent. The $this variable passed to the QLabel constructor indicates that the parent of lblMessage is the current QForm class. The concept of parent is very important to HTML controls in QCubed (QCubed calls them QControls). One of the biggest features of the QForm and QControl library is that it allows you to create sophisticated composite controls and panels using other child controls. These controls and panels can have their own layout, defined

Figure 1: Initial form created by Form_Create()

behaviour and database interactions; they can have their own validation logic and are highly reusable. For example, you could create a calculator panel that can do basic math functions. Once you have created the panel, you can use it on any page by adding just a couple of lines; there is no need to write the same code over and over again for every page. Since controls can be nested, the concept of parent becomes important in controlling the behaviour, placement and visibility. QLabel is a control that, when rendered, will create text on the page. We set the text to be displayed using the QLabel’s Text property by doing: $this->lblMessage->Text = "<strong>Create new Blog Post</ strong>";

In a very similar fashion, we define other controls. The two text-boxes txtTitle and txtBody are to allow the user to input the title and body of a blog post; the btnSubmit button is to submit these values to the server. For most QControls, the Text property defines the text they would display. For example, QLabel’s Text will appear directly where rendered; QButton’s Text will appear on the button; QTextBox’s Text will appear as the text in the input box. Every control has some common properties and some unique ones. For example, the TextMode property can exist in only QTextBox-based controls (QTextBox, QIntegerTextBox and QFloatTextbox) and can convert the text-box to a text-area, a password input control, or an HTML5 ‘search’ text-box. It is noteworthy that the Text of the label lblResult was kept blank, only so we could change it to something else later on. This line: $this->btnSubmit->AddAction(new QClickEvent(), new QAjaxAction('btnSubmit_Click'));

adds an action to the btnSubmit button for a click

OPEN SOURCE FOR YOU | March 2013  |  47


Developers

Let's Try

event. The AddAction function takes two parameters— the event, and the action. When specifying the event type, in most cases, creating a new event object inline is enough and recommended. QCubed supports all events allowed by JavaScript, and you can choose any one of them. The second parameter is the action, which can be one of these three types: 1. QServerAction: This will reload the entire page with the changes defined in the event-handler function. When a QServerAction is executed, the client sends an HTTP POST request over the wire. The server receives the request and runs the event-handler function, and makes any required visual changes to the page accordingly, and then sends back the entire page, thus reloading the page. 2. QAjaxAction: This will render the changes without reloading the page (using AJAX). In this case, the client submits the form using an AJAX request. The server runs the event-handler function, and records any changes needed for the layout. These changes are then transformed and sent to the client for reflecting the changes on screen. 3. QJavaScriptAction: This will call a JavaScript function on the client side. In this case, the event-handler function must be present on the client side. No calls are made to the server. All these actions would take one parameter—the name of the function to be called when the event occurs. In our case, the function btnSubmit_Click will be called when btnSubmit is clicked. In case of QJavaScriptAction, the function passed in as the argument must have the braces included in the call, and the function must be present on the client side—either included in another JS file, or inline in the document. QCubed cannot validate the availability of the event-handler functions, and it is the developer’s job to make sure that they exist. Our event-handler function btnSubmit_Click takes in three parameters: 1. strFormID: This is the FormID (same as the class name). 2. strControlID: This is the control ID of the HTML element that initiated the action. Control IDs are generated automatically by QCubed when a new control is created. These are the same ones used for the id attribute of the element when it is rendered. The developer can enforce a desired ID by supplying it as the second parameter to the constructor, like: $this->lblResult = new QLabel($this, ‘resultLabel’);

This will set the control ID of lblResult to ‘resultLabel’. QCubed allows only alphanumeric control IDs. 3. strParameter: This is any extra parameter that needs to be passed to the function. This parameter can be set by

48  |  March 2013 | OPEN SOURCE FOR YOU

using the ActionParameter property of the QControl. In most cases, you would not need to use them, but they are needed to be present in the event-handler function. With time, you would discover that these three parameters can help you reduce coding efforts and cut short development time even more. Now we take a look at what the event handler does. Inside the event handler, we create a new blog post object named $objNewPost. (Remember, QCubed creates classes for each of your tables, and your rows are treated as objects of the table class.) Like we did in the last article, we initialise the object with database defaults, set the value of the post title and body, and save the post. We also set the text of lblResult to ‘Post was saved’ and empty the text-boxes txtTitle and txtBody. There are a few points worth noting: 1. We retrieve the values input into QTextBox controls by just fetching theirText property value. The same property is used to set the values as well (as we did for the QButton and QLabels). You do not have to make any extra effort to retrieve values from $_POST or $_GET arrays, anywhere. 2. Though all the actions are taken via AJAX, QCubed does not require us to deal with the low-level JavaScript, and XmlHttpRequests and responses. You do not write any HTML to be sent. Just set the values to what you want, and QCubed will calculate what needs to be done by itself. 3. The event handler does not return any value—eventhandler functions will not return values. If you want to terminate the function conditionally (e.g., if the input in the txtTitle text-box was blank), then simply return without any value. 4. The server keeps a copy of the state of the application on the client side, and every time the page updates itself via a QServerAction or QAjaxAction, the server updates and syncs the copy of the page state. You do not need to worry about what data the variables contain on the server side—they always contain the last submitted value. If you use the back button, the server knows that you clicked the back button (well, not exactly, but it's safe to assume it at the outset of our journey with QCubed) and uses the corresponding state to produce the HTML. Whatever be the case, in the end, you will not have to go through anomalies. All the code in the controller file is useless if you do not Run the file. To run the file, we need to call the public static function Run, with the class name as the parameter. This function is built into QForm, and is not meant to be written manually. It tells QCubed to search for the template file in the same directory. By default, it would look for a file with the same name but ending in


Let's Try ‘.tpl.php’ instead of ‘.php’. If you want to use a different file as the view file, you may pass the filename as a second parameter to the Run function, like:

Developers

Create new Blog Post Title

NewPost::Run(‘NewPost’, ‘newpost_alternate.tpl.php’);

This will force QCubed to use newpost_alternate.tpl.php as the template file. Such a technique can be used to create multiple layouts for the same page!

The view file

The view file contains the HTML skeleton of the page. The only thing you do not have to write in this file is the HTML for the individual controls, which you defined in the controller file. You would instead call the Render function on those controls—this makes sure that QCubed takes control of their behaviour. The view file would typically begin with the HTML head section containing the page title, and any extra JS and CSS to be loaded. You might want to create a static PHP page to be ‘included’ for the purpose. Remember that, as of now, QCubed does not come with any special functions to help you with the HTML head section. All controls must be rendered between two lines: ‘$this->RenderBegin();’ and ‘$this->RenderEnd();’. An attempt to render a control beyond these boundaries will cause the framework to produce an error and halt. It is advisable to put the RenderBegin() function just after the body tag begins, and RenderEnd() just before the body tag closes. Again, controls will not render themselves unless you ask them to. If you removed the line ‘$this>btnSubmit->Render();’ from the view file, then the submit button will disappear from the page. And now, the one question we left unanswered—why does lblMessage show the strong tags on the page instead of making the text bold? It is because QCubed enables the htmlentities function for the text in all QLabel variables. In the Form_Create() function, just set: $this->lblMessage->HtmlEntities = false;

You will see (Figure 2) that the strong tag gets back its importance!

Behaviour

The page behaviour is pretty obvious. It will accept the title and body of a post, and when the Submit button is hit, it creates a new post and saves it to the database, erases the contents of the title and body input boxes, and displays a message that the post was saved.

The real power of QForms

Throughout this article, we have discovered some of the core features and functionalities of QForms. Here is how they help you: 1. Separate View and Controller files: QForm separates the

Body Submit Figure 2: With HtmlEntities set to false, QLabel honours HTML code in 'Text'

HTML layout from behaviour. Chances of messing up HTML and PHP code are lower than ever. Since ‘model’ is automatically taken care of by Codegen, we are not going to worry about that. 2. Event-driven: You define a control, bind it to an event, and write the event-handler function for the same. QForm does the rest. 3. AJAX is easy: One does not need to write JS functions, remember form element names and IDs, and there is no need to deal with the $_POST array either. QCubed does the dirty work, allowing you to focus on ‘what’ to do rather than ‘how’ to do. 4. AJAX to page reloads and vice versa: Changing the behaviour of an action from a ‘full page reload’ to ‘AJAX based’ can be done by changing just one word—the action type. 5. Less HTML than ever: QCubed produces HTML code for single elements, while you have to take care of only the overall page structure. Combined with Codegen, it means roughly 80 per cent reduction in the amount of HTML and JavaScript you would write otherwise. Also, the fact that most HTML code is automatically generated means that you have to deal with far fewer syntax errors in HTML code. 6. Stateful: The server knows the state of the page on the client side, and that improves security as well as ease of use for the programmer. This article hardly scratches the surface of QForm. There are a lot of other powerful features built into QForm; some interesting ones include—control and form validation, custom controls, database-based session handling, centralised form state handling, HTML input validation and purification for preventing XSS attacks, and so on. We will peek into a few of them in the next article of this series. By: Vaibhav Kaushal The author is a 25 year old Web developer from Bengaluru who also happens to be a core contributor to QCubed. He loves writing for technology magazines when he is not busy fiddling around with QCubed or developing his website (http://www.cintegration.com/), where he gives QCubed-related advice.

OPEN SOURCE FOR YOU | March 2013  |  49


Exploring Software

Guest Column

Anil Seth

Video Subtitle Translation

T

This column looks at how to make MOOC videos accessible to non-English speakers.

he news that California State Universities were tying up with Udacity for inexpensive MOOC (massive open online courses) for credit was not surprising. The only surprise is the speed with which the changes are taking place. I am inclined to agree with the analysis on TechCrunch (http://goo.gl/fRppX) that this online project is going to end college education, as we know it. The advantage is that a wealth of options will become available for all to learn. The disadvantage is that most of the content will be in English. Can the videos in English be accessible to students not very comfortable with the language? They would benefit a lot if subtitles (http://en.wikipedia.org/wiki/Subtitling) are provided in their language. So how does one go about getting content with language subtitles in it? The time and effort required to translate the content into the vast number of languages would be huge. Crowd-sourcing can be an answer, for example, by using http://www.amara.org/.

Subtitling/captioning and the Web

Video players can merge video frames with subtitles while playing. There are numerous formats available for subtitling; the basic content, though, will be similar. Each subtitle is a text line to be displayed, along with information about when to start the display and when to stop. The best way to provide this information is by specifying the starting time and the end time, or the duration for each subtitle. This makes the subtitle file independent of the frame rate at which a video file may be created. One common format is the SubRip (.srt extension), which was the basis of another useful format, WebVTT, which may become widespread, as it is now a W3C standard. W3C has a competing timed text (TTML) standard, which is an XML document, intended to ensure interoperability of streaming video and captions on the Web. However, the HTML5 video element supports a track element, which can be used to specify the subtitle file, perhaps in WebVTT format, and meet the needs of streaming video with captions in a user-defined language. It is common these days to have same language subtitles (http:// en.wikipedia.org/wiki/Same_language_subtitling) for television and video. The obvious advantage is that it makes content accessible to the hearing-impaired. Another advantage is its educational value. It helps practice reading as an incidental and sub-conscious part of entertainment. However, on the Web, it has an even greater significance, which is probably why Google has been in the forefront of the WebVTT format—it allows video content to be searched easily!

Machine translation of captions

Manual translation is time-consuming and expensive, even with 50  |  March 2013 | OPEN SOURCE FOR YOU

crowd-sourcing. The quantum of content is too large to be translated within a useful timeframe for all languages of interest. Furthermore, the content of technical courses is likely to be unambiguous, and not open to subtle differences in the interpretation of words and phrases. Machine translation may provide the answer. If you search the Web for open source machine translation engines, you will find Moses (http://www.statmt.org/moses/), a statistical translator, and Apertium (http://www.apertium.org/), a rulebased translator. Moses' capabilities are, in principle, similar to the software used by Google and Microsoft. However, it does not come with language models and datasets for carrying out translation—so, for it to be useful, you need to provide language models and training datasets. Apertium, however, comes with translation capabilities for a number of language pairs. The current list and status can be seen at http://wiki.apertium.org/wiki/List_of_language_pairs. Unfortunately, the progress in pure open source tools is likely to be slow. The reason is fairly obvious; Web-based translators from Google, Microsoft and others provide excellent functional alternatives. These sites have a wealth of data, e.g., pages from multi-lingual sites, which may be used for training and fine-tuning translations. If same-language subtitles are available, you may rely on machine translation for generating subtitles in a language for which a machine translator is available. YouTube provides this feature for translated captions on its site by using Google Translate, e.g., http://www.youtube.com/watch?v=1St0tJVGCW8. So, the easiest option is to use Google or Bing translators on the Web. Several open source tools had been created to translate subtitles using the Google Translate API. However, these tools no longer work after changes in the usage policy of Google's Translate API, but they may be modified to use Microsoft's translation API instead. We can hope that the MOOC course videos will make samelanguage captions available, so that machine translation can spread this knowledge to an even wider group of learners. A side lesson: The sudden changes in the usage policy for the Google Translate API reinforce the need for pure open source solutions for translation applications as well as for language models and translation datasets. The generosity of commercial sites will be aligned with their commercial interests and cannot be taken for granted.

By: Anil Seth The author has earned the right to do what interests him. You can find him online at http://sethanil.com/, http://sethanil.blogspot.com/ and reach him via email at anil@sethanil.com.


Let's Try

Developers

Programming Socket in C (TCP) This article explores the basics of writing programs in C using BSD ‘sockets’ in the IP version 4 protocol. The article published in the January 2013 issue of OSFY covered UDP socket programming; here, we take a look at socket programs using TCP (Transmission Control Protocol).

C

onsider a network application—say, a file transfer program. It has a client and server. The client connects to the server to request files for download, or to transfer files to the server (upload). Such applications need to conform to some protocol; the most common is TCP/IP, which is segregated into layers like the application, transport, network and link layers. Sockets help us get the services of the transport layer (TCP, UDP or SCTP sockets). Using RAW sockets, you can directly get the services of the network layer. With TCP, first a connection is established, then data is transferred, and then the connection is terminated. To establish a connection, three packets are exchanged between client and server, and after this ‘handshake’, data transfer takes place. In normal scenarios, one side initiates connection termination; and four packets are exchanged for a proper termination.

What does a socket program look like?

A typical socket program would have two source files, one for the server and one for the client. Our files are named lfy_tcp_

client.c and lfy_tcp_server.c. In this example, there is another file, functions.c, which contains some common utility functions for both client and server. Please download these from Github, https://github.com/mybodhizone/lfy_tcp_socket, after which they need to be compiled to make executables—say, myclient and myserver. Run these in two terminals, as shown below: [localhost tcp]$ gcc lfy_tcp_server.c functions.c -o myserver [localhost tcp]$ ./myserver TCP Server: Waiting for new client connection Server: Connection from client -127.0.0.1 Server: Received from client:hello [localhost tcp]$ gcc lfy_tcp_client.c functions.c -o myclient [localhost tcp]$ ./myclient 127.0.0.1 11710 Client - Trying to connect to server Client - Connected Successfully to server Enter Data For the server or press CTRL-D to exit hello OPEN SOURCE FOR YOU | March 2013  |  51


Developers

Let's Try

Data Sent To Server Received from server: hello Enter Data For the server or press CTRL-D to exit

If you have read the previous article in this series, you will know that my client and server are both running on the same Fedora 15 system in two terminal windows. The server listens on the ‘port number’ 11710 on the loop-back address 127.0.0.1. When the client requests some service from the server, the server processes it and waits for another client or another request from the same client. As before, the service simply returns the string received from the client. Now let's take simple algorithms for the TCP client and server. First, the client: Get the socket descriptor (using the socket function). Update a socket address structure with the server's IP address and port. Complete TCP's three-way handshake by calling the connect function. Get data for sending through the socket and send it over the socket. Receive data from the socket (from the server). Here, the process waits—that is, gets blocked. Close the socket descriptor.

A simple TCP server algorithm: Get the socket descriptor (using the socket function). Update a socket address structure with the local address and port number. Associate (bind) the above address with the socket. Call the “listen” function. Repeat forever { Get blocked in “accept” call, till it returns a connection descriptor. serve_client (connection descriptor) { Receive data from a client (Here the process waits that is get blocked) Process Received data (Specific to the particular problem) Send data to this client. If client closes connection, then close connection descriptor. break (continue waiting in accept) else continue with this function (server_client) } }

Now, please refer to the downloaded source code. The socket 52  |  March 2013 | OPEN SOURCE FOR YOU

function returns a socket descriptor (IPv4, SOCK_STREAM (TCP)) in the variable sd. An address structure struct sockaddr_ in (whose declaration is in the file /usr/include/netinet/in.h in Linux) is needed; you can get it by including the header file <netinet/in.h>. In the client code, you need to populate this address structure (the serveraddress variable) with the address family, server IP address, and port number. Note that this needs to be populated in big-endian order, so use functions/macros like htons and inet_addr. Here, htons(atoi(argv[2])) transforms the string the user passes as the command-line argument into a bigendian short integer. Similarly, inet_addr(argv[1]) transforms the IP address command-line argument into a 32-bit IPv4 address in big-endian order. Next, call the connect function in the client: ret = connect (sd, (struct sockaddr*)&serveraddress, sizeof (serveraddress));

If successful, it means that TCP three-way handshake is completed and you get a connected socket, which can be used to send or receive data. Now you can use the ‘read’ and ‘write’ functions to read/write data. An important point to be noted here is that, UDP deals with entire datagrams, but TCP is a byte oriented protocol.This requires the receiver to understand how much data to read. But this information should come from the sender. Or it can so happen that the sender sends some data, which the receiver reads and then waits to receive more data. Now if the sender closes the connection, the “read” function will return a value of 0, in the receiver's side. This might be used by the receiver to know that the peer has closed the connection. But once a connection is closed, the sender will not be able to send any more data. It again will have to initiate connection request. This may be undesirable, but this is the feature of TCP. The code below tries to read ‘n’ (passed as argument) bytes of data from the socket descriptor ‘sd’ to storage (address of a variable or name of an array). int myread (int sd, int n, void* buffer) { int ret = 0; int pointer = 0; int totnoofbytes = 0; while (1) { ret = read (sd, buffer + pointer, n totnoofbytes); if (0 > ret) { perror (“I am getting error in read!!\n”); return -1; } totnoofbytes = totnoofbytes + ret; pointer = pointer + ret; //totnoofbytes = 0 means, nothing more to


Let's Try read if ((totnoofbytes == n) || (ret == 0)) { return totnoofbytes; } } }

Similarly, while writing data, there is a function called ‘mywrite’. These utility functions are in functions.c. The bind function associates a local address with the socket, and is normally used on the server side. Check out the following code: serveraddress.sin_family = AF_INET; serveraddress.sin_port = htons (MYPORT); //PORT NO serveraddress.sin_addr.s_addr = htonl (INADDR_ANY); //IP ADDRESS ret = bind(sd, (struct sockaddr*)&serveraddress, sizeof (serveraddress));

The server’s port number and IP address (and address family) that are stored in the socket’s address structure are associated with the socket descriptor using the bind function. The purpose of htonl (INADDR_ANY) is to use a ‘wild-card’ address—if the server has multiple IP addresses, it can receive data on any of these. The listen function is used to change the state of the socket, so it can now accept connections. It also specifies the queue size of pending connections, to be retrieved. Note the server-side accept function; the first argument is the listening socket (descriptor-created using the socket call). The function blocks till a client connects; whenever it returns successfully, a new connection socket is returned, which can be used to communicate with a particular client. Also note the second and third arguments of accept—the address structure that will be populated with the client's IP address and port number, and the length, which will be updated accordingly:

Developers

write a signal handler for Ctrl-C and do any required cleanup; I've omitted this aspect to keep things simple.) References [1] Stevens, W. Richard and Rago, Stephen A. ‘Advanced Programming in the Unix Environment’, 2nd Edition, Pearson Education [2] Stevens W. Richard, Fenner Bill, Rudoff A.M., ‘Unix Network Programming’ (The sockets Networking API – Vol -1), Third Edition, Pearson Education [3] Useful Internet links are given below: a. Internet Protocol Specification: http://www.ietf.org/rfc/rfc791.txt b. User Datagram Protocol(UDP): http://www.ietf.org/rfc/rfc768.txt c. Transmission Control Protocol: http://tools.ietf.org/html/rfc793 d. For general programming/data structures tutorials: http:// www.mybodhizone.com/ e. For programming related questions and answers: http://www.ask.mybodhizone.com/

Acknowledgement I would like to thank Tanmoy Bandyopadhyay for his help in reviewing this article.

By: Swati Mukhopadhyay The author has more than 12 years of experience in academics and corporate training. Her areas of interest are digital logic, computer architecture, computer networking, data structures, Linux, programming languages like C and C++, shell scripting and Python scripting. For any queries or feedback, she can be reached at swati.mukerjee@gmail.com.

length = sizeof (cliaddr); connfd = accept (sd, (struct sockaddr*)&cliaddr, &length);

In my example, the server is an ‘iterative’ server, which means that it can serve, at most, one client at a time. You can try to make it a concurrent server by using the fork or pthread_ create calls. Also note the use of the inet_ntop function: printf (“Data Received from %s”, inet_ntop (AF_INET, &cliaddr.sin_addr, clientname, sizeof (clientname)));

This converts 32-bit IPv4 addresses (in network byte order) into dotted decimal notation (presentation format), and stores it in the clientname array. The server code runs infinitely; to terminate it, press Ctrl-C. (While you are writing your own code, it's better to OPEN SOURCE FOR YOU | March 2013  |  53


Developers

How To

Try Your Hand at the Dropbox API for Android For cloud and Android developers, Dropbox is a very handy service. It offers cloud storage and a nifty tool to sync data. One of Dropbox's biggest advantages is that it is so simple and easy to use— particularly the developer API provided. This allows developers to harness the power of the cloud effectively. This article will focus on the basics of the Dropbox API, and how to integrate it with your Android apps.

B

efore we get started, you need to set up Eclipse and the Android SDK on your system; there's plenty of information about that on the Net, so I'll skip it.

Setting up Dropbox access

Setting up the Dropbox access for your app is relatively easy and straightforward. First you have to go to the Apps page of your Dropbox account (https://www.dropbox.com/developers/ apps) and then create a new app. Once it is created, you will get the app key and the app secret key. These are unique values to your app, and are used for authenticating the connection between Dropbox servers and your app, and hence should not be shared. Also note the type of access specified when you create your app. There are two types of access you can specify: DROPBOX, which allows your app to access your entire Dropbox folder, or APP FOLDER, which only allows your app to access the folder specifically created for your app. Now, let’s proceed to create a new Android project in your Eclipse environment.

Configuration

Once you have created your Android project in Eclipse, download the Dropbox SDK for Android from the Dropbox site (https://www.dropbox.com/developers/reference/sdk). 54  |  March 2013 | OPEN SOURCE FOR YOU

Extract the files, and copy the contents of the lib folder into your Android project's lib folder. You can use the DBRoulette sample project in the examples folder as reference while doing this. After copying the libraries, tweak the AndroidManifest. xml file so that your app has sufficient permissions to access the required resources. Add the following code to your Manifest file, under the application tag: <activity android:name="com.dropbox.client2.android.AuthActivity" android:launchMode="singleTask" android:configChanges="orientation|keyboard"> <intent-filter> <!-- Change this to be db- followed by your app key --> <data android:scheme="db-APP-KEY" /> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.


How To

Developers

BROWSABLE"/> <category android:name="android. intent.category.DEFAULT" /> </intent-filter> </activity>

Note: In the line <data android:scheme="db-APP-KEY" />, replace the APP-KEY with your application key obtained from the Dropbox site. Also, you must specify in your Manifest file that your application will need to access the Internet. Hence, add an INTERNET permission in the manifest section, as follows: <uses-permission android:name="android. permission.INTERNET"></uses-permission>

Now, move on to authenticating the app.

Authentication

Figure 1: Authentication Before looking at the code, try and understand how the authentication takes place. You supply the app key, the secret app key and the access type, which you obtained during the creation of the app on the Dropbox page, to create a new session. Now, your app needs to be authorised through the official Dropbox mobile app or Dropbox mobile website. So, at this point, the user will be redirected to a page (Figure 1) that will request permission to access the user's Dropbox. Once the user accepts the app request, you will have the user's access token pair, which you can use to make various API calls. Once the app is authenticated, it will be redirected back to the activity it was executing before the authentication call. After control is returned, you must finish the authentication, binding the user's access tokens to the current session. It is also important to store these tokens somewhere after you obtain them, because if you do not, then the app will need to be authorised by the user every time it is restarted. Here is the code for the above-mentioned steps. The comments specify which parts of the Figure 2: Dropbox App code correspond to each step. //Create a new Session private DropboxAPI<AndroidAuthSession> auth; private final static String akey="INSERTACCESS-KEY-HERE"; private final static String askey="INSERTSECRET-ACCESS-KEY-HERE";

private final static AccessType atype=AccessType.APP_FOLDER; //Change to AccessType.DROPBOX if you selected dropbox access type. AppKeyPair appkeys = new AppKeyPair(akey, askey); AndroidAuthSession session=new AndroidAuthSession(appkeys, atype); auth=new DropboxAPI<AndroidAuthSession>(session);

OPEN SOURCE FOR YOU | March 2013  |  55


Developers

How To

//User accepting the request for permission. auth.getSession().startAuthentication(MainActivity.this); //Return to your app @Override protected void onResume() { super.onResume(); if(auth.getSession().authenticationSuccessful()) { try { auth.getSession().finishAuthentication(); AccessTokenPair tok=auth.getSession(). getAccessTokenPair(); storeKeys(tok.key, tok.secret); //store the user's tokens somewhere for reuse. }catch(Exception e){Log.d("info", "error", e);} } }

Note: In the last step, you override the onResume function, which is the default callback when the control returns to your app after authentication. At this point, you should have the Dropbox API set up on your Android system, and your session should also be authenticated. If you have the user's tokens stored somewhere, it is recommended that you start off this section by reinitialising the access keys, to avoid user reauthentication. You can do this by using the following lines of code: AccessTokenPair access = getStoredKeys(); //retrieve the stored tokens. auth.getSession().setAccessTokenPair(access);

Note: In order to keep things simple, this tutorial has not implemented the storeKeys and getStoredKeys methods. They should ideally be implemented when developing actual apps, as explained above. Let’s now look at the most important part of the API— the file operations using Dropbox.

Uploading a file

You can simulate reading a file using the ByteInputArray to operate on the contents of a given string. Any file on your device may also be used, by specifying the path to the file. A call to the putFile method uploads the file to Dropbox. The code for uploading a file is shown below: String content="Hello World!!"; ByteArrayInputStream ip=new ByteArrayInputStream(content.getBytes()); Entry e1=auth.putFile("/test.txt", ip, content. length(), null, null); 56  |  March 2013 | OPEN SOURCE FOR YOU

Downloading a file

Downloading is simple—use the getFile method to download your file, and store it on your Android device. The code to download a file from Dropbox (the same one you just uploaded) is: File f=new File(getFilesDir()+"/test.txt"); if(!f.exists()) f.createNewFile(); is=new FileOutputStream(f); DropboxFileInfo e1=auth.getFile("/test.txt", null, is, null);

Obtaining file metadata

This is arguably the most useful feature of Dropbox. Most applications work by making decisions based on the metadata of a given file. The Dropbox API provides a method called metadata, which returns information related to the file, like last modified, revision, path, etc. This information is handy when you want to use previous versions of the file, or when you need some form of version control. A sample use of the metadata method is as follows: Entry meta = auth.metadata("/test.txt", 1, null, false, null);

Now, putting everything together, the complete code for the MainActivity.java of your Android project is available at: http://www.linuxforu.com/article_source_ code/march13/Dropbox_Android.zip. Writing apps that use the Dropbox API is straightforward. The ease of use and flexibility of the API make it a great way to provide cloud support for your app. The API has support for many different platforms like Android, iOS, Python and Ruby, and also has many third-party APIs, which extend Dropbox support for most other platforms as well. When you face a problem using the API, a great resource to look at is the Dropbox Developers' site, at https://www.dropbox.com/developers/start/, which has a detailed overview about the use of the API. Finally, the Dropbox API for Android is a quick and powerful way of allowing your applications to take advantage of cloud storage. Android, being a prominent mobile development platform, needs tools to provide seamless integration with cloud services, and the Dropbox API does exactly this. By: Sahil Chelaramani The author is an open source activist, who loves Linux, Python and Android. He is a third-year student at the Goa Engineering College (GEC).


Let's Try

Developers

Introducing Celery for Python+Django For background task processing and deferred execution in Python with Django, Web developers and system admins can try out Celery.

A

synchronous mass email delivery, clickstreams like the number of hotels being watched or the number of likes, image resizing, video processing, connecting to third-party APIs, enhancing the user experience by executing tasks in the background rather than in the request-response loop, or executing a large number of queries on a database for reporting... these are some of the scenarios in which you might want to use distributed job queues in order to scale your application. Job queues also separate the tasks to execute in real-time from those to be scheduled for later. There are many use cases in which job queues help you achieve better user experiences. This article introduces readers to the use of Celery to leverage this in Python and Django applications. Celery is based on distributed message-passing for asynchronous task queues/job queues. It is capable of supporting both real-time operations as well as scheduled jobs. The tasks can be run on a single worker or multiple workers concurrently, to take advantage of multiprocessing. Celery provides a powerful and flexible interface for defining, executing, managing and monitoring tasks. A Celery system can consist of multiple workers and brokers, yielding high availability and horizontal scaling. Celery is suitable for applications that need to achieve any of the following: 1. Execute tasks asynchronously. 2. Distributed execution of expensive processes. 3. Third-party API usage. 4. Periodic/ scheduled tasks.

5. Retrying tasks. 6. Enhancing the user experience.

Celery architecture

Task queues are used to distribute work across workers. Celery task queues are based on the Advanced Message Queue Protocol. By default, it uses RabbitMQ as its message broker; however, users are not limited to RabbitMQ but can use Redis, MongoDB or Beanstalk too. Figure 1 depicts this process. Step 1: The AMQP receives a task from the client, which may be a Web app or a Python program. Step 2: The workers constantly monitor the queue; as soon as a message is dropped in the queue, one of the workers picks it up and executes it. Step 3: Depending on the configuration, it may or may not save the result, once it has finished processing the execution.

Setting up Celery

Although the choice of message broker is entirely your decision, for this article, I assume we are using RabbitMQ (it's what I use in production, too). Before installing Celery, you must have RabbitMQ installed and running (start it with rabbitmq-server start). Then, all you need to install Celery is pip install –U celery and you're ready to create your first program using Celery. Make a project folder, and in it, create a file tasks.py, which will contain the tasks you want to perform using Celery. Here's a sample program I’ll be using to fetch JSON and read its contents: OPEN SOURCE FOR YOU | March 2013  |  57


Developers WebApp

Let's Try 1

AMQP

2 W1

W2

W.N. Workers 3 Result Backend

To achieve the third, you need to configure this setting in your tasks.py file, as follows: celery = Celery('tasks', backend='amqp', broker='amqp:// guest@localhost//')

Now the message queue is configured to save the result of the job. You can configure any back-end that you wish to use here. This is how an immediate task is executed, though there might be use-cases wherein you would want to run scheduled jobs. To run a task as a scheduled task, you need to define the schedule in the decorator of the task, as follows:

Figure 1: Block diagram of Celery architecture from celery import Celery #Configure celery. celery = Celery('tasks', broker='amqp://guest@localhost//') @celery.task #Decorator which defines the underlying function as a celery task. def fetch_data(json_name): sleep(10) url_to_open = "http://localhost/%s" % json_name req = urllib2.Request(url_to_open) opener = urllib2.build_opener() f = opener.open(req) data_fetched = simplejson.load(f) print data_fetched return data_fetched

Now run the celery daemon from the terminal using the following command: celery worker -A tasks --loglevel=INFO

These are the minimum arguments you need to pass to start the service. Other options like events, concurrency levels and CeleryBeat can also be passed as arguments. You’ll learn about them later in the article. In another terminal, use the Python interpreter to call the tasks module file: >>> from tasks import add, fetch_data >>> result = fetch_data.delay('sample.json')

Next, track the task state/fetch the result. There are a variety of ways to achieve this, depending on your use case. For example: You just want to execute the task, and don’t want to save the result. You might want to check if the task has finished executing, or is still pending. Do you want to save the result in the message queue itself, or in MySQL or a back-end of your choice? 58  |  March 2013 | OPEN SOURCE FOR YOU

@periodic_task(run_every=datetime.timedelta(minutes=1)) def print_name(): print "Welcome to Tutorial"

The entry for period can be in the form of timedelta or in the form of cron too. Now the command for running the daemon would be: celery worker -A tasks --loglevel=INFO –B # Where B means running

CeleryBeat is used for periodic tasks; if the argument –B is not passed, then it will not run periodic tasks. Next, let’s look at how we can integrate Celery with Web frameworks—in this case, Django.

Integrating Celery with Django

Create a Django project using django-admin.py startproject simple_django_project, and then create an app in the project with python manage.py start app celery_demo. Next, install django-celery with pip install django-celery and then modify the settings.py file to configure the message queue, as shown below: import djcelery djcelery.setup_loader () INSTALLED_APPS = ( ... 'Djcelery' , ) BROKER_HOST = "localhost" BROKER_PORT = 5672 BROKER_USER = "myusername" BROKER_PASSWORD = "mypassword" BROKER_VHOST = "myvhost"

Next, sync the database with python manage.py syncdb, after which create tasks.py inside the app. Now you can create

Continued on page 60...


Guest Column Joy of Programming

S.G.Ganesh

Why Care About Design Smells? Design smells are poor solutions to recurring implementation and design problems. This article gives readers an overview on what design smells are, why we should be concerned about them, and what we can do to fix them.

M

artin Fowler describes design smells as “structures in the code that suggest (sometimes they scream for) the possibility of refactoring.” Design smells are known by various other names, such as code smells, design flaws, design anti-patterns, etc. Martin Fowler popularised the term ‘smells’ in his book on refactoring, and this is the term known to most programmers today. Why should we care about design smells? Because they are ‘problem patterns’ that can negatively impact the quality of the design, and ultimately affect the quality of the software. One way of looking at the cost of taking short-cuts to address immediate concerns is that the project accumulates ‘technical debt’. In other words, when we take short-cuts and don’t do the right thing, we have to pay a price for it—a form of ‘debt’. Over a period of time, if not addressed, this debt accumulates and when it crosses a threshold, it can result in completely derailing the software project. The stories of such failed projects are all too common. Note that this phenomenon is common in both commercial and open source projects. Consider a software development project that was led by an inexperienced designer. Assume that the project was delivered under tight schedules, and the main objective of the project was to satisfy all the functional requirements elicited from the customers, without providing much focus on NonFunctional Requirements (NFRs). This short description of the project is in fact sufficient for you to understand that the code will have numerous smells! Now, let’s explore why. One cause of design smells is when the designer makes wrong design decisions – a mistake that inexperienced designers are prone to make. Another cause is tight development schedules. When a project is developed under stiff and implausible deadlines, programmers and designers take numerous ‘short-cuts’, i.e., they do what works instead of doing what is right. From the code, you can observe these short-cuts in the form of design smells. When functionality completion is the main focus of software development and when NFRs are not given due importance, it results in sloppy design, which gets noticed as design smells. Let us discuss a specific smell to get a better understanding of the subject. One of the smells described by Martin Fowler is the ‘refused bequest’. The word ‘bequest’ means ‘a gift of personal property by will’. So, the term ‘refused bequest’

java.util.Date

java.sql.Date

java.sql.Time

Figure 1: An example of the ‘refused bequest’ smell from JDK

means ‘not accepting inherited property’. In the context of object-oriented programming, a refused bequest means ‘derived classes reject what is inherited from the base class’. Why is it a problem? Because it violates Liskov’s Substitution Principle (LSP), which is a cardinal rule in OO programming/ design. LSP states that, “We should be able to use a base reference/pointer without being aware of whether it's pointing to a derived object or not.” When there is no logical or conceptual ‘is-a relationship’ shared between the base and derived classes, we cannot use a base pointer/reference without knowing if it is pointing to the base type object or the derived type object. Let us look at an example of this smell from the open source Java Development Kit (JDK). The java.util.Date class supports both date and time functionality. The class has two derived classes: java.sql.Date and java.sql.Time, which represent date and time responsibilities (see Figure 1). The java.sql.Date class supports only date-related functionality, and throws exceptions if time-related functionality is invoked! Consider the following code segment, for example: java.util.Date date1 = new java.util.Date(2013, 01, 01); System.out.println(date1.getSeconds()); // prints 0 since zero seconds elapsed // from the start of the day java.util.Date date2 = new java.sql.Date(2013, 01, 01); System.out.println(date2.getSeconds()); // throws java.lang.IllegalArgumentException // since time related methods // are not supported in java.sql.Date open source for you | march 2013 | 59


Joy of Programming

Guest Column

As you can see, the ‘refused bequest’ smell can have a real effect on the users of the software: when programmers use these two classes, they can unexpectedly get an IllegalArgumentException. Since JDK is a public API, it is difficult to fix this mistake, since changing the interface of these classes will result in breaking backward compatibility. So how can one fix (i.e., refactor) this smell? Clearly, java.sql.Date and java.sql.Time require parts of the functionality from java.util.Date. So, if these classes use composition and contain an instance of the java.util.Date class, this problem could be solved. [As an aside, it is a bad practice to use the same name for both the base and derived classes—the name of both base and derived class is Date, in this case. The compiler accepts it because the base and derived classes are located in different packages. To address this problem, the names of the classes java.sql.Date and java.sql.Time could be changed to java.sql.SQLDate and java.sql.SQLTime

respectively, to avoid having the same names (though in different packages).] Unlike ‘refused bequest’, most other smells don’t have visible or directly perceivable effects on the end software quality. However, that doesn’t mean they are not important. An analogy would be the internal cracks in a bridge or a building. These cracks may not immediately cause the structure to collapse, but if left unaddressed, they would develop further and will eventually bring down the structure. Similarly, design smells, whether their impact is externally perceivable or not, have a real impact on the quality of the software. If they are left unaddressed, they can wreak havoc and eventually result in the failure of the software project.

By: S G Ganesh The author works for Siemens (Corporate Research & Technologies), Bengaluru. You can reach him at sgganesh at gmail dot com.

Continued from page 58... a URL entry in urls.py that maps to a function in view, which will be used to call the tasks that we have defined in tasks.py. Run the Celery daemon now, with the following commands: python manage.py celeryd -l info -c 2 # Without CeleryBeat python manage.py celeryd -l info -c 2 –B # With CeleryBeat

This is a simple method to integrate Celery with Django.

Adding multiple workers

Now scaling workers is not a concern—all you need is to ship your tasks app to a new machine, set up Celery and just start running it. The Celery daemon will start talking to the message queue, and multiple workers will start executing tasks. Celery makes sure that your task is executed once, and not by multiple workers.

Monitoring

As your application grows, so will the need to make it more stable and robust. To achieve this, you need to monitor all the components of your Celery set-up.

Monitoring RabbitMQ

To check the number of messages in your queues via the console, simply run rabbitmqctl-status, which will list all queues, with the number of messages in each queue. For a GUI-based output, you can simply install the RabbitMQ management plug-in. 60 | march 2013 | OPEN SOURCE FOR YOU

Monitoring Celery

First of all, to manage Celery, you need to switch events on— start the Celery daemon with the option -E, so the command would become python manage.py celeryd -l info -c 2 –B –E. This starts to capture events, and now you can monitor your workers, task states, etc, using: Celery command-line utilities Django-Celery admin Flower: A real-time Celery Web-monitor Celery is one of the most stable systems available. It is very easy to get started with, very simple to configure, fast at executing millions of tasks, and flexible, as almost any component of Celery can be used on its own, changed, or configured as per requirements. Some other great features of Celery are: 1. Designing workflows: To chain multiple tasks, you can use canvas to divide your tasks into sub-tasks. 2. Webhooks: To enjoy the power of Celery using other languages like PHP, Ruby, etc. 3. Routing: Send tasks to a particular queue rather than any queue, and to implement all the routing mechanisms that the message broker supports. There are loads of other great features of Celery, which are beyond the scope of this article. I am sure that if you have a use-case, chances are that you can do it with Celery. By: Konark K. Modi The author works as a senior systems engineer with Website Operations at Makemytrip.com, and is a technology enthusiast at heart. Follow him at: @konarkmodi.


Let's Try

Admin

Going Virtual With OpenVZ This article is an introduction to OpenVZ, an open source containerbased virtualisation solution for Linux.

I

n computing, virtualisation is the creation of a virtual version of a hardware platform, operating system, storage or network resource. Let's briefly look at each type. Hardware virtualisation: This provides an environment to create virtual machines and there are three different types—full, partial, and para-virtualisation. In full virtualisation, each OS instance and its applications run in a separate VM on top of virtual hardware. The computer system is available as a software construct with the same behaviour as a physical computer system. There are two types of full virtualisation: bare metal, by which the hypervisor runs on the underlying hardware, without a host OS; and hosted virtualisation, by which the hypervisor runs on top of the host OS (such as Windows or Linux). In partial virtualisation, the virtual machine simulates multiple instances of much of an underlying hardware environment—specifically, address spaces—but not the entire OS. In computing, para-virtualisation is a technique that represents a software interface to virtual machines that is similar, but not identical to, that of the underlying hardware resources. Network virtualisation: Here, the physical network is segmented into logical parts to provide network virtualisation by combining network resources such as switches, NICs, firewalls, load balancers, VLANs, storage devices, Ethernet and Fiber Channel, as well as network functionality into a single, software-based network administrative entity. In internal network virtualisation, a host is configured with guest containers to create a virtual network in a box. In external network virtualisation, networks are shared or sub-divided into virtual networks using VLANs and switches.

Storage virtualisation: This is the union of multiple network storage devices into something that appears to be a single storage unit. It provides abstraction on top of various storage techniques, and hence enables flexibility. Memory virtualisation: This decouples RAM from individual systems in the data centre, and aggregates them into a virtualised memory pool, which can be made available to any computer in the virtual environment. Software virtualisation: Broadly, we can categorise this into three types: OS-level virtualisation, by which multiple virtualised environments (multiple isolated user-space instances) can be hosted within a single instance. Application virtualisation is related to hosting individual applications separated from the underlying OS. Service virtualisation is emulating the behaviour of dependent components that are needed to execute an application for development or testing purposes. Data virtualisation: This is the process of abstracting databases, files, etc, with the use of a single data access layer. Desktop or client virtualisation: This is the virtualisation technology of separating the desktop from the physical machine.

OpenVZ

OpenVZ is a container-based virtualisation solution for Linux. It creates multiple isolated and secure Linux servers known as Virtual Private Servers (VPS) on a single physical machine. Figure 2 depicts its architecture. Each container or VPS performs and executes instructions exactly like a stand-alone server. A VPS has root access, users, processors, memory, IP addresses, OPEN SOURCE FOR YOU | March 2013  |  61


Admin

Let's Try

VIRTULIZATION Hardware • Full • Bare-Metal • Hosted • Partial • Para

Network • Internal Network Virtulizaion • External Network Virtulization

Storage • Block Virtulization • File Virtulization

Memory • Application Level • OS Level Integration

Software • OS Level • Application • Service

Data • Database

Software • Virtual desktop Infrastructure • Hosted Virtual Desktop

Figure 1: Types of virtualisation

files, system libraries and configuration files, applications, ports, and routing rules. OpenVZ is an open source product available under the GNU GPL (General Public License). So how do OpenVZ containers differ from the traditional virtual machine architecture? Well, they run on the same OS kernel as the host system, but allow multiple Linux variants in individual containers. This single-kernel implementation enables running containers with much less overhead. Hence, OpenVZ offers higher efficiency and manageability than traditional virtualisation technologies. It uses a single patched Linux kernel, and as a result can run only Linux—and doesn't have the overhead of a hypervisor (a tiny part of the CPU resources is used on virtualisation—around 1-2 per cent); it is fast and efficient.

OpenVZ features

The main features are listed below. P

H h o y s t s i c # a 1 l

Root access Users, Processors, Memory, Files, Applications Virtual Private Server

Root access Users, Processors, Memory, Files, Applications Virtual Private Server

OpenVZTemplate Open VZLayer Host OS Hardware Network

P

H h o y s t s i c # a 2

Root access Users, Processors, Memory, Files, Applications Virtual Private Server

l

Root access Users, Processors, Memory, Files, Applications Virtual Private Server

OpenVZTemplate Open VZLayer Host OS Hardware Network

Figure 2: OpenVZ architecture

OpenVZ uses a single kernel (Linux) implementation and hence it is as scalable as the Linux kernel. Virtualisation overhead is very low (approximately 1-2 per cent). Live migration of VPS and the checkpointing feature allows users to migrate a VPS from one physical host to another without needing to shut down the VPS. Resource management allows OpenVZ to share available host system resources among VPSs in an efficient manner; it guarantees QoS—not only providing performance, resource isolation, and protection from denial-of-service attacks, but also collecting usage information to monitor the system’s health. By default, direct access to hardware is not available. 62  |  March 2013 | OPEN SOURCE FOR YOU

OpenVZ has undergone a thorough security audit, which was performed by Solar Designer. IPsec is supported inside containers since kernel version 2.6.32. OpenVZ technology scales up to thousands of CPUs and terabytes of RAM. Therefore, the benefits include near-zero overhead, strong isolation, improved flexibility, efficiency, and quality of service. Note that Oracle, DB/2, WebLogic, WebSphere and other big applications run efficiently inside OpenVZ containers. Applications and services need not be OpenVZaware. Along with standardised server management, note that OpenVZ kernels are based on Red Hat Enterprise Linux kernels, which are conventional and well maintained. By default, OpenVZ restricts container access to physical devices, making containers hardware-independent. Its limitations are that OpenVZ supports only Linux distributions and not Windows. The /dev/loopN devices are often restricted in deployments, which restricts the ability to mount disk images. OpenVZ is restricted to providing only a few VPN technologies based on Point-to-Point Protocol (PPP), such as PPTP Point-to-Point Tunnelling Protocol (PPTP), Layer 2 Tunnelling Protocol (L2TP) and TUN/TAP (virtual network kernel devices). OpenVZ Use-Cases

Development and testing

Developers and testers need access to different Linux variants to develop and test an application—hence, testing and development groups often require a lot of hardware resources. By using OpenVZ, developers and testers can create multiple partitions with different Linux variants and configurations residing on one physical host.

Hosting

Useful to have isolated users and costefficient containers that behave like a server, to support multiple versions of an application, and offer easy administration.

A comparison of OpenVZ with its counterparts

How does OpenVZ compare with other virtualisation technologies such as Xen, KVM, VirtualBox, VMware Player and VMware Workstation? Table 1 gives a comparison.


Let's Try

Admin

Table 1

Type of hypervisor

License

Host OS supported

OpenVZ

Xen

KVM

VirtualBox

VMware Player

VMware ESX/ ESXi

Hosted

Bare-metal

Hosted

Hosted

Hosted

Bare-metal

Proprietary

GPL

GPL

GPL version 2

GPL version 2

Proprietary, free of charge for personal noncommercial use

Linux

NetBSD, Linux, Solaris

FreeBSD, Linux, Illumos

Windows, Linux, Mac OS X x86, Solaris, FreeBSD, eComStation

Windows, Linux

No host OS Windows, Linux, Solaris, FreeBSD, OSx86 (as FreeBSD), virtual appliances, Netware, OS/2, SCO, BeOS, Haiku, Darwin, others: run arbitrary OS

FreeBSD, Linux, Solaris, Windows

DOS, Linux, Mac OS X Server, FreeBSD, Haiku, OS/2, Solaris, Syllable, Windows

Windows, Linux, Solaris, FreeBSD, OSx86 (as FreeBSD), virtual appliances, Netware, OS/2, SCO, BeOS, Haiku, Darwin,

Guest OS supported

Linux variants

FreeBSD, NetBSD, Linux, Solaris, Windows XP & 2003 Server

USB support

Yes

-

Yes

Yes

Yes

Yes

Live migration

Yes

Yes

Yes

Yes

No

Yes

Snapshots per VM

Yes (Vzdump)

Yes

Yes

No

Yes

GUI

Yes (EasyVZ)

Yes

Yes

Yes

Yes

Yes

Installation and configuration

1. Download the repository file and (all these steps must be performed as the root) put it in the ‘/etc/yum.repos.d’ directory:

vzkernel-headers.i686 : Header files for the Linux kernel for use by glibc Name and summary matches only, use "search all" for everything

wget http://download.openvz.org/openvz.repo

2. Import the GPG key that belongs to the repository: rpm --import http://download.openvz.org/RPM-GPG-Key-OpenVZ

3. Find the OpenVZ kernel package: yum search vzkernel vzkernel.i686 : The Linux kernel vzkernel-debug.i686 : The Linux kernel compiled with extra debugging enabled vzkernel-debug-devel.i686 : Development package for building kernel modules to : match the debug kernel vzkernel-devel.i686 : Development package for building kernel modules to match: the kernel vzkernel-firmware.noarch : Firmware files used by the Linux kernel

4. Install vzkernel.i686 with yum install vzkernel and it will automatically update the GRUB bootloader. 5. Edit /boot/grub/menu.lst to verify the OpenVZ kernel entry. title OpenVZ (2.6.32-042stab072.10) root (hd0,0) kernel /vmlinuz-2.6.32-042stab072.10 ro root=UUID=954e09c7-75ba-426d-aeca-c79d00ed3d16 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet initrd /initramfs-2.6.32-042stab072.10.img title CentOS (2.6.32-279.el6.i686) root (hd0,0)

6. After installing the OpenVZ kernel, you need to install OPEN SOURCE FOR YOU | March 2013  |  63


Admin

Let's Try

user-level tools for OpenVZ (yum install vzctl vzquota); vzctl is used to perform different tasks on VPSs such as Start, Stop, Create, Destroy, Set parameters, etc, while vzquota is used to manage the VPS quotas. 7. Edit /etc/sysctl.conf and add or modify the following settings: 8. Load the new settings with sysctl –p 9. Open /etc/vz/vz.conf and set NEIGHBOUR_DEVS to all. 10. SELinux needs to be disabled; edit /etc/sysconfig/selinux and set the value of SELINUX to disabled. 11. Reboot the system. You can check the release with uname –r and should get something like 2.x.xx-xxxstabxxx.x. 12. OpenVZ is installed in a way that it is possible to boot the system either with OpenVZ support or without it. At present, it is not possible to create VPSs. Different VPSs can run different versions of Linux. A VPS is based on a specific OS template; OS templates are packages available with OpenVZ. You need to install the corresponding OS template in OpenVZ to create a VPS. After you install at least one OS template, you can create any number of VPSs with the help of standard OpenVZ utilities, and can configure their network, and work with these VPSs as you work with fully functional Linux servers. First download a CentOS template: wget http://download.openvz.org/template/precreated/centos6-x86_64.tar.gz

The client can be run on the same machine: cd gui/ python ezvz.py

Monitoring system resource consumption

It is possible to check the system resource statistics from within a VPS, which allows you to understand what particular resource limits are preventing an application from starting. These statistics report the current and maximum resources consumption for the running VPS, and can be obtained from the /proc/user_beancounters file: vzctl exec 101 cat /proc/user_beancounters

Monitoring memory consumption

Users can monitor memory parameters for the hardware node and for particular VPSs: vzmemcheck –v

The –v option is used to display the memory information for each VPS.

Enabling VPN for a VPS

13. Copy the downloaded template into /vz/template/cache. 14. Each VPS must have its own unique ID (here, we used 121) and create the VPS with:

A Virtual Private Network allows you to establish a secure network connection over an insecure public network. It is possible to set up a VPN for a separate VPS via the TUN/TAP device. 1. The tun module needs to be loaded before OpenVZ is started; you can load it with:

vzctl create 121 --ostemplate centos-6-x86_64 --config basic

lsmod | grep tun or modprobe tun

15. Set a hostname and IP address for the VPS:

2. Allow the VPS to use the TUN/TAP device:

vzctl set 121 --hostname testvps.com --save vzctl set 121 --ipadd 192.168.0.201 –save

vzctl set 121 --devices c:10:200:rw –save

16. You can now start the VPS with vzctl start 121; stop it with vzctl stop 121 and restart it with vzctl restart 121.

EasyVZ: OpenVZ management GUI

EasyVZ is a GUI management console for OpenVZ. It lets you easily create, destroy, manage and monitor VPSs. The pre-requisites for using it are: 1. You have to have an OpenVZ-enabled kernel running. 2. All OpenVZ utilities need to be installed. 3. To create new VPSs, you need templates installed in /vz/ template/cache. The source distribution contains two directories; the backend directory contains the server source code. Start the server on the OpenVZ node that you intend to manage: cd backend/ python server.py 64  |  March 2013 | OPEN SOURCE FOR YOU

3. Create the subsequent device inside the VPS and set the proper permissions. References [0] http://en.wikipedia.org/wiki/Comparison_of_platform_ virtual_machines [1] http://en.wikipedia.org/wiki/Network_virtualization [2] http://en.wikipedia.org/wiki/Storage_Virtualization [3] http://en.wikipedia.org/wiki/Memory_virtualization [4] http://wiki.openvz.org/Main_Page [5] http://wiki.openvz.org/VPS_vs_Dedicated [6] http://wiki.openvz.org/Use_cases [7] http://sourceforge.net/projects/easyvz/ [8] http://download.openvz.org/doc/OpenVZ-Users-Guide.pdf

By: Mitesh Soni The author is a Technical Lead at iGATE. He is in the Cloud Services (Research & Innovation) Group and loves to write about new technologies. Blog: http://clean-clouds.com


Overview

Admin

Ensuring Security on Open Source Virtual Platforms We must thank IT virtualisation, as it led us to cloud technology. Today’s IT infrastructures are already running their mission-critical business applications on virtual machines. Like physical infrastructure, virtualisation is also cursed with cyber security challenges. This article talks about a typical open source virtualisation solution, along with the steps to secure it.

A

s we know, a virtual server is a resource-based instance of an operating system. It consumes the pre-configured amount of CPU speed, memory and disk space from the physical hardware. An important lowlevel software component called HAL (Hardware Abstraction Layer) sits in between the physical hardware and the operating system (OS). HAL is responsible for converting OS calls into a set of CPU instructions and vice-versa, thus enabling highlevel application stacks to run smoothly. HAL also makes the OS independent of the hardware components, and thus makes it portable across multiple physical platforms. Virtualisation is achieved by adding another lowlevel software layer along with HAL, which allows us to simulate multiple virtual machines on a single physical

machine, whereby each virtual machine (VM) can run its own (copy of an) OS. Since this layer works together with the HAL, it provides great flexibility for us to select the OS, or assign a dedicated CPU and other resources to a particular machine. Figure 1 shows the basic building blocks of the virtualisation architecture. A component called the virtual session manager runs in parallel with guest instances in order to allocate system resources and monitor usage. In theory, there are three types of virtualisation. The first type is called a hypervisor, which means it is fully virtual, wherein all guest instances are kept separate from each other. In the second type, called para-virtualisation, the guest systems know about each other. This is achieved by semi-abstraction of the physical OPEN SOURCE FOR YOU | March 2013  |  65


Admin

Overview Guest Application

Guest Instance (OS)

Host OS

Virtualization Layer

Physical Hardware

Virtualization Layers Figure 1: Virtualisation architecture—the basic blocks

and OS layers. The benefit in this method is that it takes a lower toll on system resources, resulting in faster guests— but it compromises on security. The third type is called OS-level virtualisation, in which the abstraction layer simulates multiple instances of the host OS. Hypervisor is the most famous type of installation.

Xen open source virtualisation

As we all know, the open source world has been blessed with Xen, which provides the great features of an industry-standard hypervisor technology. Xen allows us to create multiple guest instances and seamlessly schedules CPU time, and partitions memory spaces. The Xen architecture contains three main components: the hypervisor layer, the domain manager and the guest instances. The Xen domain manager is a kernel component that runs before any other guest instance can be started. It provides functions such as allowing the creation of child domains, creating and managing virtual devices for guest domains, and also controlling network and disk resources. Guest instances are not allowed to access hardware resources directly—in fact, they communicate with the domain manager through proxy calls to ask for access. They also update the domain manager about their online or offline status.

Securing open source virtualisation

As we discussed earlier, the OS HAL layer and hypervisor components work hand-in-hand to achieve virtualisation. However, it also means that the invasion of any of these components can effectively make the entire virtual layer and guest instances vulnerable to cyber attacks. It is very important to keep in mind that virtualisation is a software component, and can be affected by programmatic as well as man-made cyber attacks, just like any physical server infrastructure. Securing a virtual infrastructure is done by effectively securing each of the layers that form it. Let's first talk about typical attacks that can render a virtualisation infrastructure insecure. Hypervisor attacks: This is a serious type of attack, whereby the attacker exploits a vulnerability of the hypervisor 66  |  March 2013 | OPEN SOURCE FOR YOU

layer that communicates with the HAL and guest OSs, thus infecting the entire infrastructure hosted on a physical server. There are viruses specifically designed for this purpose. The most critical moment for causing hypervisor infection is during the installation phase. Guest OS security: From a system administrator’s point of view, the VMs are pretty much the same as physical servers. Hence, all the security management techniques for physical machines apply to the VMs too. Leaving guest OSs unpatched, or not performing the correct security lockdown, can result in serious vulnerabilities. Guest communication security: It is highly likely that guest OSs hosted on the same virtualisation infrastructure will communicate with each other. This TCP communication is usually routed through a redirector service, which is part of the hypervisor layer. Hence, there is no packet transmission on the physical network card of the physical server hosting the infrastructure. While this improves communication speeds, it introduces a limitation whereby Intrusion Detection Systems cannot detect network-layer problems. This limitation needs to be addressed correctly, else it can make serious vulnerabilities invisible to security monitoring. Guest hopping attacks: In this type, the attacker can gain control of one of the guests (VMs), and then make use of a famous exploit called ‘hypervisor escape’, which can let attackers traverse from one guest system to another (called guest hopping), thus infecting the whole infrastructure. This attack is usually used to create zombie machines, which are then used to plant a distributed denial of service attack. Management console attacks: Each virtualisation infrastructure provides a Web-based console interface for administrators to add/remove machine resources or to monitor the guest OSs. This console can introduce Web-layer attacks, which can help attackers gain control of the virtual infrastructure. Hyperjacking: In this rare type of attack, the attacker gains control of the physical host, and creates a bogus VM. Alternatively, the attacker can get hold of an existing test virtual instance, which was deployed during the initial installation phases. Such instances are usually ignored, and hence left un-patched, thus making for vulnerable components. Attackers can make use of such machines for malicious purposes. Besides these that are specific to virtualisation servers, others, such as authentication attacks, man in the middle, packet crafting, denial of service, etc, also apply.

Virtualisation security

The following table shows the various system components of the virtualisation infrastructure, and the corresponding security layers required for end-to-end security.

Continued on page 69....


Let's Try

Admin

A Look at the Basics of LVM This article deals with Logical Volume Management (LVM) and looks at how to set it up.

M

any years ago, when 2 GB of storage was considered a lot, I beamed with pride after installing two hard disks, each 2 GB. With 4 GB, I was sure of never running low on space. Such pride is shortlived, as we know. Down the road, it was a limitation when I wanted to install more software into my Linux distro (those were the days when Red Hat Linux was the thing to have) and the disk that had my root partition just didn’t have the space. There had to be some way to resolve the issue; after all, my system had a total of four gigs, right? Was there a way I could, well, ‘combine’ the two drives? Yes, there was: three letters of pure genius, LVM. Logical Volume Management, put simply, is a concept that combines physical drives and makes them appear as contiguous spaces.

Within these VGs, you can create partitions, called Logical Volumes (LVs). The operating system will never know the difference; the behaviour is the same as accessing any regular disk/partition. The benefits of LVM over regular filesystems include: dynamic resizing of VGs, and live snapshots of partitions without unmounting them. Let's now jump right in to how to set up LVM on our system. The OS I'm using for this is Ubuntu 12.10. There are two scenarios in which one would set up LVM: while performing a Linux install, or post-installation. LVM can be configured using command-line and GUI tools. I shall walk you through all of this.

The basics of LVM

LVM is a virtual layer that sits sandwiched between the operating system and your storage devices, i.e., hard disks. It creates groups of your hard disks, called Volume Groups (VGs).

OPERATING SYSTEM AND DATA LOGICAL VOLUMES PHYSICAL DISKS AND VOLUMES

Figure 1: What LVM actually does (is)

Figure 2: Starting LVM partitioning

OPEN SOURCE FOR YOU | March 2013  |  67


Admin

Let's Try

Figure 5: Initialising a disk/entity

Figure 3: The LVM configuration tool

Figure 6: Initialising a disk/entity Figure 4: Initialising a disk/entity

Setting up LVM during Install

Ubuntu’s default installation image does not allow LVM, so we will use the Ubuntu Alternate Install disc. Grab the alternate ISO from the Ubuntu Download page (it's under ‘Additional options’) and boot from it. I would like to go on record to state that I was able to do all the steps below using the standard ISO of Ubuntu 12.10 as well—which means the alternate ISO is not required, even though Internet sources claim one must use the alternate ISO for LVM support. On the disk partitioning screen (Figure 2), select ‘Erase disk and install Ubuntu’; check the ‘Use LVM with the new Ubuntu installation’ and click ‘Continue’. After selecting the LVM partitioning option on the previous screen, the installer will automatically select the main hard drive to use for initialising the LVM set-up. The installer will then write a basic layout to disk. That’s about it. The installer now installs GRUB—which happens in the MBR, since the BIOS can’t read LVMs. Any extra /boot partition required will automatically be created, and the installer will then proceed with the rest of the installation. It’s super easy, isn’t it? Now, using LVM tools, you can configure your LVM to add or remove more disks, extend or shrink volumes, etc.

Setting up or configuring LVMs in an existing system

I will show you how to configure or modify the previously created volumes. The same steps may be used to set up a fresh LVM configuration if you have Ubuntu already installed. 68  |  March 2013 | OPEN SOURCE FOR YOU

Figure 7: Unused space now available in the existing VG

Let's install the GUI tool ‘system-config-lvm’. Initially available only from the Fedora RPM, this tool is now supported from the Ubuntu repos, thus saving you a lot of work including ‘transcoding’ the RPM to DEB using alien. To install it is now as simple as issuing the following command at a terminal: sudo apt-get update sudo apt-get install system-config-lvm

Once installation is complete, fire it up from the main menu (search for ‘LVM’), or you can launch it from a terminal with sudo system-config-lvm. The application's main screen is shown in Figure 3. Next, I will show you how to add a new disk and partition (physical volume) to the volume group, and extend the existing (root) logical volume. So, let’s touch upon adding and editing logical volumes. Adding a new disk/partition to an existing volume group: The uninitialised disk is shown in the ‘Uninitialised Entities’ branch; so initialise it by hitting the ‘Initialise


Let's Try Entity’ button, and the tool proceeds to warn you and perform initialisation (Figures 4 and 5). Once initialised, the partition is moved into the ‘Unallocated Volumes’ (Figure 6) branch. Here, click the ‘Add to Existing Volume Group’ button, which prompts Figure 8: Editing a Logical Volume you to select the volume group (VG) to which you will add this partition. This adds unused space to your ‘ubuntu’ VG (Figure 7). Then edit an LV, and add this unused space into it (Figure 8). Select the LV adjacent to the unused space, and hit the Edit button. Note that you can now extend the volume by

Admin

dragging the slider. Drag as required, and hit ‘OK’! This will add the unused space to your LV. This is how LVM configuration is done using the GUI. The command-line provides you with a comprehensive set of commands to do this, but it's risky for a new user, since a wrong command can cause you to lose data. LVM is very useful, since you can add, extend and remove volumes irrespective of the physical disks in the system; you can combine disks to appear as single drives. LVM eases upgrading and extending disk capacities. Fundamentally, working with LVM is almost the same as working with regular partitions; the only difference is that in the case of LVM, we deal with a ‘logical’ space and its relation to ‘physical’ space—also known as storage virtualisation. I hope this article has whetted your appetite to explore storage technologies in greater depth. Have fun! By: Siddharth Mankad The author is a new media designer, with an affinity for physical computing, computer software and code, as well as country music.

Continued from page 66.... Virtualisation layer

Security implementation

Physical host

• Physical security • Firewall • Intrusion Detection System

Host OS

• OS hardening • Access control

Virtual HAL

• Install from genuine source • Avoid stray instances • Apply security patches

Guest OS

• OS hardening • Access control • Patching

Guest application

Application-level security installations and controls

Implementing security for a virtualisation infrastructure is a methodical and multi-step process. We need to begin with the physical infrastructure, followed by the installation and the hardening of OS on it. If Xen server is being installed from scratch, getting an infection-free copy of the distribution is critical. The next step is to configure user-level security, enabling access only to administrators, to create, delete or modify the guest OSs. It should be ensured that no stray guest instances are left lingering on the infrastructure, and should be deleted if found. While configuring guest OSs, it is important to remember that

each instance may run a different make or version. Hence, a unified patch-management solution that can cater to heterogeneous systems needs to be deployed. The same is true for the anti-virus software. Besides patching, each OS should be hardened and configured for correct security accesses. As mentioned earlier, the communication between guest instances is not visible on the physical network interface; hence, an intrusion detection system should be deployed. The correct way to do this is to dedicate one guest instance on each virtual infrastructure for the purpose of packet sniffing and intrusion detection. Physical security for virtual servers is very crucial, because stealing a physical machine means stealing more than one VM, thus resulting in serious data theft or infrastructure breakdown. For VMs hosted in the demilitarised zone, a proper perimeter defence system comprising firewalls and UTM devices should be deployed too. By: Prashant Phatak The author has over 22 years of experience in the field of IT hardware, networking, Web technologies and IT security. Prashant runs his own firm named Valency Networks in India (http://www. valencynetworks.com) providing consultancy in IT security design, security penetration testing, IT audits, infrastructure technology and business process management. He can be reached at prashant@valencynetworks.com.

OPEN SOURCE FOR YOU | March 2013  |  69




Admin

Let's Try

Deploying a Ticket Request System with OTRS In the current business scenario, customer management plays a major role in the success or failure of a company. Tracking issues and giving clients the necessary support and assistance in real time is crucial in providing quality service. This article covers an open source solution to help you in serving your customers with greater efficiency.

O

TRS (Open-source Ticket Request System) is free and ticket-free system software that can be used to provide your customers a platform to raise issues that need to be resolved. This article leads you through the steps to deploy it and get a feel for it. OTRS is based on Perl, so you must have Perl installed on your system. I am using RHEL6, which bundles the Perl packages, so all I need is to issue the yum install perl* command, and Perl will be installed. Now, you need to download OTRS before you can install and test it. Get it from http://www.otrs.com/en/open-source/get-otrs/softwaredownload/. Once you have downloaded it, follow the steps indicated below: Double-click the RPM file or install it using the rpm command. It will also ask for a few dependencies to be installed, which you can do. OTRS runs on a Web-based interface, so you need to install Apache using the yum install httpd* command, and start the httpd service using the service httpd start command. Now, you need to install your database server—issue the yum

72  |  March 2013 | OPEN SOURCE FOR YOU

install mysql* command to install the MySQL database, and then start the service with service mysqld start. Now all the required packages are installed, and it’s time to start the database configuration for OTRS. Follow the steps given below: cd /opt/otrs

Open /opt/otrs/README.database to assist you in configuring the database for OTRS. I am using MySQL, so I’ll go with the MySQL steps of this file. Issue the following commands at your command prompt: mysql -u root mysql -u root sql mysql -u root sql mysql -u root mysql.sql

-p -e 'create database otrs charset utf8' -p otrs < scripts/database/otrs-schema.mysql. -p otrs < scripts/database/otrs-schema.mysql. -p otrs < scripts/database/otrs-initial_insert.


Let's Try

Admin

Figure 1: OTRS first screen

Figure 2: Raising a ticket mysql -u root -p otrs < scripts/database/otrs-schema-post. mysql.sqlmysql -u root -p -e 'GRANT ALL PRIVILEGES ON otrs.* TO otrs@localhost IDENTIFIED BY "otrs" WITH GRANT OPTION;' mysql -u root -p -e 'FLUSH PRIVILEGES;'

Start the OTRS service using the service otrs start

command. Also make sure to adjust your firewall and SELinux settings, or turn them off. Next, point your browser to http://localhost/otrs/index.pl and you’ll get the login screen of OTRS. Log in with the OTRS admin account username root@localhost and the default password root. After successfully installing OTRS, it’s time to see it working. Let’s create a customer and then this ‘customer’ can raise a ticket. Click the CUSTOMERS tab in the home screen, and fill in the necessary details of that customer and submit it. Now point your browser to http://localhost/otrs/customer.pl and log in with the newly created customer credentials. I have created a user named vinayak and logged in with this account. Once logged in, just click New Ticket to raise a ticket. Once you’ve typed your problem statement, submit it, so that it can be tracked and resolved. Again log in to the admin account as before, and under the New Tickets section, you’ll see the ticket the customer had raised. Just click the link to view it. If you click Lock, it signifies that this ticket is currently being processed— someone's taking care of it. So here, the cycle of raising a ticket and acknowledging it is complete. Now we can take the necessary actions to resolve this problem. This was a basic overview of how OTRS can raise and manage trouble tickets. I can't cover all aspects of this cool tool here, so I suggest you visit its website for more. You can also test-drive OTRS at http://www.otrs.com/en/ software/otrs-help-desk/online-demo/. Keep exploring and wait for my next article!

By: Vinayak Pandey The author is a Red Hat Certified Engineer on RHEL6, spending most of his time exploring open source tools and technologies, while fine tuning his Linux machine.

OPEN SOURCE FOR YOU | March 2013  |  73


Admin

Let's Try

Kick-Starting Virtualisation with VirtualBox

This article looks at some quick steps for installing, configuring and working with Oracle VM VirtualBox.

V

irtualisation has been growing in popularity ever since it first appeared on the scene in the early 1960s, as an effective and reliable way to share compute resources across mainframes by the creation of multiple virtual machines, each running with their own defined RAM and disk space. Virtualisation software adoption gained impetus from the year 2005 onwards and has grown ever since, faster than anyone (including the experts) imagined. There are three main areas of IT where virtualisation is currently making inroads—network virtualisation, storage virtualisation and server virtualisation; but for this article we are going to look at a much simpler version called Operating System Virtualisation. Operating System Virtualisation enables users to create multiple guest operating systems (OS) within a single ‘host’ OS (see Figure 1). The host OS is the one that you see when you start your computer. Each guest OS is provided with some definite RAM and CPU from the host machine, for its consumption. Such virtualisation is useful when you are aiming to do research, testing or development work, where virtual machines can be flexibly provisioned, used, and then

74  |  March 2013 | OPEN SOURCE FOR YOU

deleted after some time. This actually helps save time and the cost of procuring unnecessary hardware. There are a lot of open source as well as commercial OS virtualisation software on the market, each with its own pros and cons. Here’s a quick comparison between some of the most widely used OS virtualisation products: QEMU, Oracle VM VirtualBox, VMware Player and Parallels Desktop 8 for Mac.

Introduction to VirtualBox

VirtualBox is a cross-platform virtualisation software designed to run on most modern x86 systems. Initially developed by a company named Innotek, VirtualBox was bought over by Sun Microsystems in 2008 and is now developed by Oracle Corporation as part of its family of virtualisation products. VirtualBox is installed on an existing host OS as a simple application. You can then create additional virtual machines (VMs) with this, which contain guest operating systems. Each guest OS gets its own virtual environment that comprises some dedicated CPU, RAM as well as hard disk space. Besides these, VirtualBox also provides some additional useful features such as:


Let's Try Features

QEMU

Admin

Oracle VM VirtualBox

VMware Player

Parallels Desktop

Definition

QEMU (short for ‘Quick EMUlator’) is emulation software that provides a set of dynamic device models that enable it to run a variety of unmodified guest operating systems.

Oracle VM VirtualBox is a cross-platform virtualisation software meant for x86-based systems.

VMware Player is an x86 virtualisation software application made by VMware, Inc. It is installed on an existing host OS as an application. This host application allows additional guest operating systems to be loaded and run, each with its own virtual environment.

Parallels Desktop for Mac by Parallels Inc is software providing hardware virtualisation for Mac PCs with Intel processors.

Method of operation

Paravirtualisation and porting or hardware virtualisation. Runs on x86, ARM, Sparc64-32, OpenRISC

x86 Virtualisation

x86 Virtualisation

x86 Virtualisation

Host CPU

x86, x86-64, IA-64, PowerPC, SPARC 32/64, ARM, S/390, MIPS

x86, x86-64, Intel VT-x, AMD-V

x86, x86-64, Intel VT-x, AMD-V

x86, Intel VT-x

Guest CPU

x86, x86-64, Alpha, ARM, CRIS, LM32, M68k, MicroBlaze, MIPS, OpenRisc32, PowerPC, S/390, SH4, SPARC 32/64, Unicore32 and Xtensa

x86 and x86-64

x86 and x86-64

x86 and x86-64

Supported host OS

Windows, Linux, Mac OS X, Solaris, FreeBSD, OpenBSD and BeOS

Windows, Linux, Mac OS X x86, Solaris, FreeBSD and eComStation

Windows and Linux

Mac OS X

Supported guest OS

Windows, Linux, Mac OS X, Solaris, FreeBSD, OpenBSD, BeOS and others; runs arbitrary OS

DOS, Linux, Mac OS X Server, FreeBSD, Haiku, OS/2, Solaris, Syllable, Windows and others; runs arbitrary OS

Windows, Linux, Solaris, FreeBSD, OSx86 (as FreeBSD), virtual appliances, Netware, OS/2, SCO, BeOS, Haiku, Darwin and others; runs arbitrary OS

Windows, Linux, FreeBSD, OS/2, eComStation, DOS, Solaris and Haiku

Provides guest OS drivers

No

Yes

Yes

Yes

Snapshots facility

Yes

Yes

No

Yes

Commercial support availability

No

Yes (with a commercial licence)

Yes

Yes

Licensing

GPL/LGPL

GPL version 2; full version with extra enterprise features is proprietary

Proprietary, free of charge for personal noncommercial use

Proprietary

Costing

Free

Free

Free

Commercial

Product Link

http://goo.gl/890fO

http://goo.gl/HLYfh

http://goo.gl/K0g5F

http://goo.gl/BD825

OPEN SOURCE FOR YOU | March 2013  |  75


Admin

Let's Try

APPLICATION

APPLICATION

Windows 2008 R2 VM

RedHat VM

wget -q http://download.virtualbox.org/virtualbox/debian/ oracle_vbox.asc -O- | sudo apt-key add -

Next, add the repository from where you are going to download VirtualBox:

VIRTUAL MACHINE MONITOR (VirtualBox)

HOST OPERATING SYSTEM (Ubuntu 12.10 Desktop)

Network

RAM

Hard Disk

Figure 1: A virtual system

Shared folders: With this feature, you can permanently or temporarily connect your host OS folders and use them as a network drive in your guest OS. Snapshots: A snapshot of the guest OS can be taken at any point. This helps you to revert the state of your guest OS in case something goes wrong with it. State saving: When you close the OS window, you are given the choice of sending a shut down signal, powering off, or saving the current state. Seamless mode: Like Parallels on Mac, this integrates the guest OS with your host OS’ desktop. The latest release of VirtualBox (v4.2.6) additionally comes with Windows Aero support and guest VM cloning facilities.

Installation and configuration on Ubuntu 12.10

VirtualBox can be installed on Windows, Solaris, Linux and the Mac iOS. In this section, we look at how to install and configure VirtualBox on Ubuntu 12.10 Desktop (Quantal Quetzal). There are two ways of doing this. The first would be to manually download the VirtualBox DEB file from https://www.virtualbox.org/wiki/Downloads to your Ubuntu system and run it. However, this does not work all that well at first run; you may run into some complications like missing dependent packages or even issues with the kernel driver. All these can be solved, but take time and effort—so let’s explore the easiest way. Simply launch a terminal window and run the commands given below. Note: In Linux, launch a terminal window using the key combination Ctrl–Alt–T; Mac users need to substitute Ctrl with the Cmd key. The first step is to add a software repository key into the sources.list.d/virtualbox.list file: 76  |  March 2013 | OPEN SOURCE FOR YOU

Next, update your Ubuntu system with the necessary packages and updates, and then install VirtualBox: sudo apt-get update sudo apt-get install virtualbox-4.2

HOST HARDWARE CPU

sudo sh -c 'echo "deb http://download.virtualbox.org/ virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/ sources.list'

The installation will take some time to complete. Once done, you can start VirtualBox with the terminal command virtualbox, and you should have VirtualBox up and running. sudo apt-get install linux-headers-3.5.0-17-generic sudo /etc/init.d/vboxdrv setup

Note: ‘Failed, trying without DKMS’ is a very common error faced while installing VirtualBox on Ubuntu systems. To solve this, first download the correct Linux headers depending on the description of the error message, then run the vboxdrv setup command to recompile the kernel module and install it, and you should be able to launch VirtualBox successfully.

A Windows Server 2008 R2 VM

Once you have your VirtualBox set up, creating VMs is a fairly simple process. The following steps outline the VM creation process for Windows 2008 R2 Server. You'll need the Windows 2008 R2 Server ISO DVD image (you can download a 60-day trial from http://technet.microsoft.com/en-us/evalcenter/dd459137.aspx). Launch VirtualBox and click the New icon to create a new VM. You will now see a New Virtual Machine Wizard, which walks you through the steps of selecting virtual resources for your Windows VM. The first dialogue box helps you select the type and version of the OS you are going to install as the guest OS. Provide a suitable name for the VM here as well. Once done, click Next, then select the amount of RAM you want to allocate to this VM. Note: Always set VM RAM to less than that of your host (physical) machine’s RAM, since the host OS will require RAM for running itself and other applications. The next step is to create the VM’s hard disk. By default, it asks you to create a new hard disk from scratch using a Create New Virtual Disk Wizard. Select the correct Type of hard disk that you want for your VM, and provide a suitable size (in GB) for it.


Let's Try

Admin

Figure 3: Windows installer screen Figure 2: VM configuration

Note: You can always add more hard disks to your VM after it’s created. Once you have created the VM, you are now ready to power it on. A sample final configuration is shown in Figure 2. Power on your VM by clicking the ‘Start’ icon. Once started, you will need to choose Devices > CD / DVD Devices > Choose a virtual CD /DVD disk file. Here, browse for the Windows 2008 R2 ISO file downloaded earlier. Once selected, go back to your VM and press Right Ctrl–H to reset your VM, and you should see the Windows 2008 R2 Server welcome screen, as shown in Figure 3. In a similar way, you can create Linux and Windows VMs using your VirtualBox set-up. Simply select the correct OS type and version from the wizard, create a hard disk, allocate

RAM and CPU resources, and power on the virtual machine! That’s it for now. Stay tuned for more such tutorials and articles! References [1] https://www.virtualbox.org/ [2] http://en.wikipedia.org/wiki/Comparison_of_ platform_virtual_machines

By: Yohan Wadia The author is a senior software engineer and part of the Cloud Services Team (Research and Innovation) at iGATE. An avid blogger and technologist, he loves exploring all upcoming technologies and trends in the IT industry. Blog: http://www. yoyoclouds.com/.

OPEN SOURCE FOR YOU | March 2013  |  77


Admin

Let's Try

Open Source Access to MS Exchange Server Using DavMail This article introduces DavMail and demonstrates its importance in corporate scenarios for accessing mail from MS Exchange Server.

M

any enterprises use Microsoft Exchange for corporate e-mail; usually, there's no avoiding it. While Exchange can provide IMAP/POP services, these are frequently disabled citing security reasons, leaving Outlook Web Access (OWA) as the only hope for users of non-Microsoft mail user agents (MUAs). But losing important emails is one of the major concerns, due to the limited space provided by Exchange Server. Apart from this, there are many Linux enthusiasts and government authorities who have now stopped working on Windows due to the increasing popularity of Ubuntu and similar Linux distros. Moreover, organisations invest huge amounts on purchasing MS Outlook for each desktop. MS Exchange uses proprietary MAPI protocols, which are incompatible with the open protocols that Thunderbird and other clients use. So here’s a nice solution that lets you use any email client to connect to Exchange Server with a third-party gateway, in a secure way (optional encryption) and, of course, it’s free. The popular FOSS website SourceForge. net explains its architecture: “The main goal of DavMail is to provide standards-compliant protocols in front of proprietary

78  |  March 2013 | OPEN SOURCE FOR YOU

Exchange. This means LDAP for a global address book, SMTP to send messages, IMAP to browse messages on the server in any folder, POP to retrieve inbox messages only, CalDAV for calendar support, and CardDAV for personal contacts sync. Thus, any standards-compliant client can be used with Microsoft Exchange. The DavMail gateway is implemented in Java, and should run on any platform. Releases are tested on Windows, Linux (Ubuntu) and Mac OS X. Tested successfully with the iPhone (gateway running on a server).” Figure 1 shows various applications using DavMail (the yellow icon) to connect to OWA (Outlook Web Access) and Exchange. Using OWA instead of proprietary MAPI or IMAP/SMTP protocols itself ensures secure communication with the server. For smartphones, DavMail is used as a dedicated host to provide SMTP and IMAP services to those devices, hiding all the server configuration from those socalled less secure Internet devices. It also supports set-up of calendars and CardDAV protocol to sync address books. We tested DavMail 3.9.9 using Thunderbird 13.0.1 (you can explore the latest versions) with Lightning (a Thunderbird


Let's Try

Admin

Microsoft Exchange IMAP SMTP LDAP Caldav

Evolution Linux

OWA on MS WebDavEWS

IMAP SMTP LDAP Caldav Carddav

WebDav

WebDavEWS

DevMail Server

WebDavEWS

Thunderbird Lightning Saga

IMAP SMTP Caldav Carddav

CalDav

Windows

IMAP SMTP

IMAP SMTP Cal Mail

LDAP Carddav Adress Book

Mac OSX

Figure 1: DavMail and mail applications

Figure 3: LDAP settings—part 1

Figure 2: DavMail gateway settings

add-on for the Calendar set-up) on Windows XP and Windows 7. Given below are the steps to set it up. Download and install Mozilla Thunderbird from http:// www.mozilla.org/thunderbird/ and DavMail from http:// davmail.sourceforge.net/download.html.

DavMail configuration

After installation, you can find DavMail running in your system tray. Right-click it and select Settings. In the Main tab, enter your Outlook Web Access URL (see Figure 2). Leave the rest as it is. Go to the Proxy tab and enter your proxy details if you are behind a proxy server; else, skip this. Now, DavMail is running on our desktop itself— localhost. If it's installed for use as a service on a dedicated host, you'd use the IP address/hostname for that system in your email client settings—for instance, as is shown below for Thunderbird.

Figure 4: Calendar settings

Note: We recommend you uncheck the option ‘SMTP save in sent’ in DavMail -> Advanced settings. This will avoid having two copies of an email in Sent Items.

Thunderbird account configuration

Run Thunderbird after installation. The first run will start a wizard to create an account. Enter your name, email ID and the password given to you by your IT support team and click Continue. Now Thunderbird will try to auto-configure the account; just stop it by clicking the Stop button. You should get a plain configuration screen with some default values. Click the Manual Setup button and set up localhost as the server hostname, and the ports defined in DavMail: POP port 1110, IMAP port 1143 (for receiving email from Exchange); and OPEN SOURCE FOR YOU | March 2013  |  79


Admin

Let's Try

SMTP port 1025 (to send emails). Also ensure that Connection Security (in Server Settings for the account) is None (that's for the connection between Thunderbird and DavMail), and configure the other account settings according to your requirements. Next, let’s look at LDAP configuration. In your Account Settings dialogue box, select Composition & Addressing in the left pane and choose Use a different LDAP server (Figure 3). Click Edit Directories, and you will be shown an LDAP server configuration dialogue box. Click the Add button to add your local LDAP server. Here are some sample settings (except the port): Name: Exchange Hostname: localhost Base DN: ou=people Port number: 1389 (the port set in DavMail configuration; Thunderbird will use this to fetch address books from Exchange so it can auto-complete email addresses in new messages.) Bind DN: domainname\username Click OK twice to return to Composition & Addressing, and select the newly created Exchange entry under Use a different LDAP server.

you need the Lightning add-on, which you can easily install from https://addons.mozilla.org/en-US/thunderbird/addon/ lightning/. Next, from Thunderbird's File menu choose New -> Calendar. Select On the Network and click OK. Select Format as CalDAV (see Figure 4). Enter Location as ‘http:// localhost:1080/users/my_name@domainname.com/calendar’ (sample setting, replace with your details). DavMail's CalDAV port is 1080. Click Next. Enter some nickname for your calendar, and click Next and Finish. Note: There are various add-ons available other than CalDAV for Thunderbird, like ‘Exchange 2007/2010 Calendar and Task Provider’ and ‘Provider for Microsoft Exchange’, which are also useful for calendar configuration in Thunderbird. The first one looked very useful—it allowed me to specify ‘Out of Office’ settings and automatic responses to meeting requests—but remember that it's not supported for Thunderbird 15 or later. Voilà! That’s it. Now you are ready to use Thunderbird through DavMail to access MS Exchange Server. Go ahead and enjoy the beauty of FOSS! By: Pranav Chauhan

Calendar configuration

The author works as an IT analyst in a well-known Indian software exporting company, and takes an interest in exploring open source software to spread awareness about using it in day-to-day life.

Now you need to synchronise your calendar with Exchange Server to receive event notifications in Thunderbird. For this,

THE COMPLETE MAGAZINE ON OPEN SOURCE

www.electronicsforu.com

www.eb.efyindia.com

80  |  March 2013 | OPEN SOURCE FOR YOU

www.linuxforu.com

www.ffymag.com

www.efyindia.com


Cloud Corner

For U & Me

For Start-Ups, the Cloud is the Way to Go! Experts opine that cloud technology has the potential to bridge the gap between a small and a large enterprise. For start-ups and SMBs, cloud computing can make life far easier for IT admins, as well as improve the bottomline!

A

ccording to Gartner's analysis, cloud computing has the potential to change IT in a big way. Gartner analysts opine, “It may end up removing the last vestiges of the captive IT organisation that owns its enterprise, as surely as the enterprise owns IT.” It’s not just enterprises and SMEs that are leveraging cloud technology; start-ups are not far behind. India, a country at par with many of the majors with respect to entrepreneurship, is seeing a spike in this trend. Start-ups are taking that extra step of getting on to the cloud and making the most of this phenomenon.

Why do start-ups need the cloud?

The cost of IT infrastructure consumes a good share of the budget of any organisation. Start-ups that are already short of funds in the initial stages feel the heat of expensive IT infrastructure. So, if a solution can cater to almost all their IT needs at a lower cost and with fewer worries, they go for it. The cloud is the answer for them. Yet, despite the fact that the cloud is a must-adopt trend currently, companies are taking their time in giving away direct control of their IT infrastructure to someone else.

Explaining the need for cloud computing in a startup set-up, Rajesh Shetty, vice president, Cisco India and SAARC, says, “Cloud computing is the most reliable and scalable platform for a start-up as well as for an SMB, because it can fit itself perfectly, as per their requirements. Start-ups or SMBs, unlike large organisations, do not have a big IT team; nor do they have all the required resources in terms of infrastructure or budgets. So, the cloud is a solution that they can resort to, as they would get a very scalable and reliable global infrastructure, which is easy to use and costeffective from the ROI perspective.” With cloud computing, start-ups do not have to worry about creating their own IT infrastructure or employing manpower to manage it. They can simply get it done by the cloud service providers. Reiterating what Shetty said, Ajit Gadge, manager, Sales Engineering, and database solutions architect for India, South-East Asia, Australia and New Zealand, EnterpriseDB, said, “The cloud can deliver a reliable global infrastructure to a small organisation at an affordable price. Small organisations across India are looking forward to the cloud and I OPEN SOURCE FOR YOU  | MARCH 2013  |  81


For U & Me

Cloud Corner

think the Indian market is a perfect place to have cloud computing in place. From the business owner’s point of view, the adoption of cloud computing may not be an easy and quick decision to make as one would have to totally rely on some third party and its IT infrastructure, but once the entire picture is made clear, the industry would soon start adopting cloud computing.” It is not about just the cost of the equipment, at the end of the day. It is about the total infrastructure costs. Shetty adds, “If you want to set up a data centre, the equipment would take about 20 to 25 per cent of the overall cost of the data centre, but the other associated IT resources like power, back-up and cooling require more investments. One would need trained manpower to manage the entire set up as well. So, the story doesn't end with the initial investment of the equipment cost. It’s the life cycle cost that matters.” Some of the advantages that cloud solutions offer a startup are listed below. Low cost: The cloud will always win over physical storage drives when it comes to money. For a start-up, the cloud can help reduce the IT budget significantly. Owning and maintaining physical storage requires more IT spending, and creating data backups can also make a huge dent in IT budgets. Easy access: The cloud ensures hassle-free access to stored data. From a start-up or SMB's point of view, maintaining a separate IT team to maintain data will be unaffordable. Also, for non-technical small business owners, the cloud can ensure reliable access to data. Scalability: The cloud provides the advantage of scalability. A business can scale up or down on the cloud infrastructure, as per its requirement. The scalability can happen within no time and without much investment. Automation: With cloud computing, IT admins of start-ups need not worry about maintaining applications. One doesn't need to invest in a team to keep the file storage system updated, as most of the applications that run on the cloud are capable of getting updated automatically.

The cloud bridges the gap between start-ups and enterprises

V Ramachandran, country manager, Converged Infrastructure & Cloud Solutions, Cloud Systems, HP India, says, “Cloud technology has the potential to bridge the gap between a small and a large enterprise. With the cloud, small organisations can benefit from the services of world class IT infrastructure. The cloud is slowly spreading its wings across the horizon, as it offers a tremendous amount of reach. Even government departments are now exploring the possibilities of empowering themselves with the cloud as it gives a big boost in providing services to the citizens. Apart from being a cost-effective solution, the cloud can help in managing both resources as well as data effectively. Given the growing number of small businesses in India, the day is not far when 82  |  march 2013  |  OPEN SOURCE FOR YOU

How a start-up benefited from the cloud Vserv.mobi, a mobile ad network company, is a start-up that leverages cloud technology in a big way. Ashay Padwal, co-founder and chief technology officer, Vserv.mobi, explains the business model, “We host mobile advertisements for our clients. We need to be totally flexible and scalable in order to offer our services perfectly. On a given day we may have only 20,000 ads to host, but the next day our clients may demand hosting of 100,000 advertisements. This kind of scalability is possible only with the cloud. The need for elasticity, when we are unable to estimate the changing hardware requirements from day to day, is one of the crucial reasons that propelled us to deploy a cloud solution in our organisation.”

companies from all spheres would look at using cloud computing in a big way.”

Cloud telephony: An emerging solution for start-ups

One emerging trend amongst start-ups and SMBs is the adoption of cloud telephony. This can be simply defined as configuring a telephone in a browser. Through cloud telephony, one can virtually carry the desk phones on the browser, and make and receive calls through the computer itself. Cloud telephony is a solution that cuts costs by about five to six times compared to setting up the traditional infrastructure for an ePABX system, with telephone lines and handsets. Ambarish Gupta, chief executive officer, Knowlarity (a cloud telephony company) explains, “A start-up doesn't need to invest in the hardware required for fixed landlines, when it goes for cloud telephony. The traditional telephony set-ups work best when one sets up a proper office. For start-ups, there are hardly any offices in the beginning. So cloud telephony works best for their connectivity from which ever location they are.” Cloud telephony can help in better management of time along with the provision for remote working, and increase overall efficiency.

Worries about data security

Cloud computing does provide multiple benefits, but startups are still sceptical about data security. Experts opine that small organisations can opt for the cloud any time, but larger organisations are a bit hesitant to give direct control of their IT infrastructure to some third-party vendor. Gadge opines, “Before opting for a cloud solution, customers should evaluate the contract with the service provider. They should be aware enough to understand the security checks in the cloud solution.”

By OSFY Bureau



For U & Me

Insight

mind, which was originally born at AT&T Labs. Dennis Ritchie and Brian Kernighan were the key people who created UNIX. Their book about C language programming became a truly classic edition in Russia, on the basis of which many generations of engineers are taught. The flexibility of Linux, the prevalence of the C language, and the philosophy of UNIX caused such widespread interest. One of the first commercial companies that started working on the market was IPLabs Linux Team in 1998. It was initially involved in localisation activities, but later began to sell box versions as well—ranging from Mandrake to Red Hat and SuSE. Its tight cooperation with MandrakeSoft made it possible to create its own Linux distribution. In 2001, such distro-building experience led to the creation of a software-only company called AltLinux, with its own distribution carrying the same name as the company. After years of Linux experience, AltLinux now has the fourth largest repository in the world— Sisyphus. The AltLinux company builds server distributions for OEM companies and also builds desktop versions, as well as participating in government activities like the ‘School Project’. In the fall of 2008, AltLinux produced the SKIF 4.1 distribution for the national supercomputer SKIF-MSU. In 2009, the company opened up a sales centre in Porto Alegre, Brazil. In the year 2000, SWsoft had also decided to try its luck in the Linux world. It dedicated a special unit ASPLinux, which was supposed to bring a fully localised Russian distribution (with the same name—ASPLinux) based purely on Red Hat. It must be noted that the ASPLinux distro wasn’t a simple clone of Red Hat, because it used several in-housedeveloped applications. For example, instead of LILO, it ran ASPLoader—a graphically enabled boot-strap utility. There were also ASPInstaller and ASPDiskManager—a master disk partitioning utility. ASPLinux Server versions were preinstalled with virtualisation products named Virtuozzo—some open-source portions of which later evolved into OpenVZ technology. Due to certain reasons, the development of this distribution came to an end in 2008. Quite possibly SWsoft, already known as Parallels Inc, considered that it was commercially viable to develop the virtualisation business itself, rather than evolve in the Linux-friendly direction only. That’s why we now see such brilliant technology as OpenVZ available almost in every hosting provider. The story behind the MandrakeSoft company and its influence on the Russian Linux market was not simply limited by AltLinux in the late 90s. In 2007, Russian-based firm Mezon opened up a Mandriva Center of Competence located in St Petersburg. This enabled the firm to get the Mandriva distribution certified to be used in the government sector, as well as in places where confidential information was stored and processed. Moreover, three years later in 2010, the NGI Fund (with a Russian background) bought off majority stakes both in Mandriva as well as in the Russian company PingWin Software. This made it possible to perform systems integration and generate a new company—RosaLab. This step also allowed 84  |  MARCH 2013  |  OPEN SOURCE For You

Mandriva to be saved from collapsing. Now, by combining efforts to further develop Mandriva Linux, which now comes under the Rosa Linux name, RosaLab envisions converting Rosa Linux into a Russian nationwide distribution—but who knows what the future holds. However, saving the company in 2010 basically brought along many benefits. According to DistroWatch statistics (http://distrowatch.com/stats.php?section=popularity), Mandriva (or should I say Rosa Linux) again gained popularity. In addition, a couple of other companies tried to develop their own distributions, though Linux wasn’t their core business. This way, MOPSLinux appeared on the Russian market in 2004, originally developed by the Network company only for its own internal projects. The company was a developer of information systems for local administration units and enterprises. MOPSLinux is based on Slackware with Russian localisation and includes a number of applications developed in-house. The company offered technical support, both free and on a subscription basis. Unfortunately, in 2010 the company ceased Linux distribution, and apparently closed down—the financial crisis touched Russia too. Although several efforts were made to keep this distribution under the AgiliaLinux name, there are serious doubts it could continue being purely a voluntary project. However, a better example is the experience of the Calculate company, for which the Linux business also isn’t a major focus at all, because it produces cardboard and corrugated cardboard packaging. The company created a distribution called CalculateLinux for its own needs, when transferring its IT infrastructure to Linux in 2007. CalculateLinux is based on Gentoo Linux. Corporate graphical designers helped with the distribution’s UI; that’s why CalculateLinux has gained such popularity outside the mother company. Besides, free help is provided online via IRC and Jabber services. All other distros could be considered more or less amateurish and non-professional from the business perspective—especially since all of them are designed for home users, and based on modern versions of either Ubuntu or Fedora from Red Hat. When we start to discuss corporate Linux versions, both IT integrator companies and government agencies tend to use original and unmodified distributions such as RHEL, SLES, CentOS, Debian and AltLinux Server. It should also be noted that the Ministry of Defence has its own versions of Linux called MCBC—a Mobile System for the Armed Forces. The government research institute created it early in 2003 on a Red Hat Linux base, with broad consultancy support from one of Russia’s Red Hat partners. Fundamentally, there’s nothing special about MCBC though—a simplified UI interface a la Windows95 and certified internal components to monitor access to the system. What could be particularly interesting is the fact that MCBC has been ported to MIPS, x86 and SPARC platforms. The system is distributed among large government customers on a paid basis and isn’t available in the public domain.


Insight Another Russian company that creates exciting business solutions is Etersoft. It sells its boxed solutions built upon a heavily redefined WINE package. Thus, one of the most promising products is SELTA@Etersoft—a universal SQLqueries translator from T-SQL into pgSQL. Such transformation allows the use of the PostgreSQL server for a number of applications designed purely to work with Microsoft SQL Server only. So how does the translator work? It parses requests to MS SQL system tables, and adapts them transparently to PostgreSQL notation. So you don’t need to interfere either with the server or the client program. Many companies that can’t completely transfer their business onto a Linux platform (due to Microsoft SQL Server or Win32-applications) choose SELTA@ Etersoft and WINE@Etersoft and happily launch Win32applications within GNU/Linux environments. Now let me describe the problems that occur with GNU/Linux once it is deployed in real life by Russian companies. The main problem is the quality and experience of the technical personnel, who’re primary responsible for the transformation project—from Windows to Linux. The vast majority have never faced any UNIX system before. Therefore, they have great difficulty orienting themselves to the UNIX philosophy and they follow one simple principle—dumb replacement of one Windows GUI with a similar-looking GUI, but under the Linux logo. Naturally, the features that make Linux a truly unique system aren’t reclaimed and aren’t used at all. The second reason is a difficult-to-eradicate myth about the importance of a nationwide distribution. If there had been one created earlier, with Russian (Hindi, Brazilian, you name it) localisation and other bells and whistles, it would be distributed in a blink of an eye. However, the long history of AltLinux shows another trend—there could be, de-facto, an already existing national distribution. In our case, AltLinux has no rudiments of the original MandrakeLinux because AltLinux was completely redesigned 10 years ago. There already exists a great channel to spread AltLinux both on CDs/DVDs, as well as multiple tutorials written by AltLinux authors for teaching and learning purposes, and there’s great support from the company. But there’s still Windows domination. Why? On the one hand, there is strong pressure from both the Microsoft side and from the financial department of any enterprise that decides to purchase Win32/ Win64 products only. This can be explained only by this fact— real ignorance of whatever systems exist outside the Microsoft world. However, even when decision makers are aware of Linux/ UNIX, their reason is usually this one: “We have specialists familiar with Microsoft, but we haven’t any Linux specialists. Therefore, we take Microsoft.” Strange, isn’t it? Sadly, the truth is that sometimes, companies do not even have an IT department with sufficient Microsoft experience. Another big problem is a strong existence of other myths (this is particularly evident with MCBC Linux): “There exists a purely native (Russian/Indian/German) Linux innovation and only selected specialists are keen to understand it.” This problem

For U & Me

is really a huge one, because when some kind of problem arises, there’s usually a solution outside of this closed world. For example, you should try to find fixes for Ubuntu packages not within the Ubuntu world only, but among Debian users too! The third big problem is that engineering and IT personnel training is done with Microsoft products. This situation is rather typical for middle schools, as well as for higher education institutions. The courses devoted to UNIX topics are organised and created mostly by enthusiasts or organised by big vendors—so such training can be considered as supplementary to the selling channel of Linux software and middleware. The education policy in this aspect is still driven by the country’s educational agency. But the real surprise comes from a place no one expected before. First, Russia has a national search giant—Yandex. It uses Linux for its own purposes—server infrastructure. So it’s allocated its resources to maintain the huge repository of core Linux distributions: AltLinux, ArchLinux, ASPLinux, CentOS, Debian, Ubuntu, Slackware, Mandriva, and others. It has also provided space for such office suites as OpenOffice, LibreOffice and Mozilla. They mirror kernel.org, VLC, MySQL, KDE, GNOME and some others. From this perspective, the national software repository is already here. Moreover, the agreements on free peering are achieved with a number of local ISPs throughout the whole country. This fact alone creates an ideal opportunity for sharing any distro. In addition to free access to the Yandex repository, it also provides free hosting facilities to video, pictures, Web hosting, etc. So there’s no problem in distributing any books, presentations or videos on Linux. SMB-sized companies that have Linux-familiar IT staff silently migrate their network infrastructure onto Linux/ FreeBSD/OpenSolaris, because its mission-critical nature allows firms to have 24x7 business. Occasionally, the government sector behaves similarly, unless there’s particular Win32 software imposed from the federal government level. Having IT infrastructure based on Debian, Ubuntu or CentOS allows a government institution to save money, and instead of spending on Microsoft products, it can purchase more hardware or order custom software. The bigger advantages are from professionals that come to the government sector from commercial companies. They bring experience and knowledge with them and that is most important—the desire to change the infrastructure to be the one ‘right’ standard. Unfortunately, this is a temporary scenario, due to the financial crisis and other local factors. Once the business situation improves, such personnel return to the private sector where wages are usually higher. In Russia, there exists an analogy to the Linux Foundation, known as the Russian Association for Free Software (RASPO). The idea behind it is rather strong, but unfortunately this committee tends to operate like a software ‘club’—promoting the business ideas of its members and not general Linux principles, as it should. Having been created in 2009, nobody can see it in a big, serious project, though.

Continued on page 88...

OPEN SOURCE For You | MARCH 2013  |  85


For U & Me

Review

Viridis: A Low-Power, Linux-Powered Super Server! Viridis is a 5W server! It is interesting to note that Linux was the first choice of operating system for this unique high-performance computing system, and proved to be the best.

O

ne of the biggest problems faced by data-centre operators is the amount of power consumed and dissipated by the servers. As a result, there is a lot of focus on building low-power servers these days. ARM processors are known for their low-power capabilities, but have traditionally been used more in mobile devices and laptops than in supercomputers. However, in the last couple of years, there has been a lot of interest in building ARMbased servers, and such products are being launched by companies like Boston, Marvell, Tilera and Calxeda. One that seems very promising is Boston’s Viridis, an energyefficient data-centre solution based on Calxeda’s low-power, ARM-based System-on-Chip (SoC).

ARM—a logical choice for data centres

“In data centres, the server is the revenue-generating asset of the business, and there is a strong business motivation to look at new technology. Companies look to drive down the 86  |  March 2013  |  OPEN SOURCE FOR YOU

acquisition cost of the hardware, and the running cost of the platforms. You can think of these data centres as energyconstrained systems. A data centre gets allocated a certain amount of power, and it must generate as much revenue as it can, and minimise running costs. As the servers are specialist machines, there is an opportunity for silicon and systems companies to optimise platforms for a specific application. ARM Guru Ganesan, managing director, has proved in the mobile ARM, India Operations phone space that the way ahead is development of highly integrated SoC devices,” says Guru Ganesan, managing director, ARM, India Operations.


Review Venkat Ramana, vice president, Hinditron Infosystems, a premier business and technical support partner of Boston Ltd in India, says, “With energyefficient computing being the major focus area in the realm of high-performance computing (HPC), it is time to explore alternatives to the current industry-standard processors. In this context, presently, the ARM Venkat Ramana, vice president, architecture seems to be the most Hinditron Infosystems ideal candidate. ARM processors are available from many vendors, and have the required economies of scale because of their sheer volume and wide deployment in the mobile market.” Calxeda’s EnergyCore is one of the first ARM-powered SoCs that has been specifically designed to address the server market. Ganesan feels that Calxeda is uniquely placed because the well-funded start-up focuses solely on the server industry, while other ARM silicon partners that are entering or intend to enter the server market are engaged in other application areas to generate revenue. By far, EnergyCore is the most highly-integrated server processor on the market. In addition to including networking and storage interfaces on-chip, the chip uses a special fabric to remove the need for traditional top-of-rack switches and external baseband management controller devices, significantly reducing system power and cost. In terms of applications also, it is specifically tuned to the needs of data-centre applications, such as Web hosting, storage servers, data analytics and content streaming. Boston’s Viridis was one of the first ARM-powered server platforms to enter the market, and the first to be available in India. It was also the first to work so closely with Calxeda and make full use of the EnergyCore SoC.

Viridis—a quick overview

“Boston was the first company in the world to launch servergrade products based on ARM. We had a deep engagement with Calxeda in bringing our solutions to the market, and Viridis is the result. The Viridis system is designed from the ground up to deal with the requirements of scale-out data-centre workloads, with the internal fabric capable of scaling to over 4000 nodes today (without the need to go to a David Power, technical head, HPC group, Boston Ltd, UK top-of-rack switch) and future releases that will scale to hundreds of thousands of nodes,”

For U & Me

says David Power, technical head of the HPC group, Boston Ltd, UK. At the heart of Viridis is SoC technology, which integrates the central processing unit (CPU), networking and input-output (I/O) onto a single server chip. Viridis uses Calxeda’s ARMbased EnergyCore SoCs, which consume less than 5W of power. These are interconnected by a Manoj Nayee, Manoj Nayee, special highly scalable fabric managing director, Boston Ltd, UK that offers extremely low latency high-bandwidth communication between all servers. This fabric is coupled with an intelligent management controller for power and fabric optimisation and management, for energy-proportional computing. The Viridis platform has five core chips, of which one is reserved for the management engine; only four cores are exposed to the operating system. Thus, the management and fabric do not interfere with the host performance. The disk I/O allows for up to 5 SATA devices to be populated per host, for users with dataintensive requirements. Manoj Nayee, managing director, Boston Ltd, UK, says, “Using the very same CPU technology that powers many of today’s mobile consumer devices, the Viridis offers around 90 per cent improvements in energy efficiency and density. These building blocks of high-end computing are set to radically change the economics of large-scale data centres, sparking innovation in emerging fields such as cloud computing, data modelling and analysis (often called ‘Big Data’), scientific research and media streaming.”

Low-power engineering

According to Power, the platform had to undergo a lot of engineering to get the product down to the power levels seen today. These include: silicon optimisations, EnergyCard optimisations, power-optimised fabric settings, optimised power supply, baffles to improve airflow, memory/RAM settings, and fan settings. “ARM was always the technology we had planned on using for our Viridis product. It had to be ARM, as we wanted to bring a really disruptive green technology to the server market. Power consumption (and the cost!) was becoming a real headache for a lot of our customers, and ARM was one of the leading low-power chips in the market. We have a very close working relationship with ARM, and their roadmap is very exciting. We have also been engaged with Canonical (Ubuntu) and Red Hat/ Fedora, who are heavily involved in porting their distributions to the ARM platform; I'm delighted at the progress that has been made in this space, particularly to provide users with a familiar working environment (both for development and administration). This combination made the choice of ARM a very compelling proposition. You also have communities and organisations such as Linaro (http://www.linaro.org/), which are investing a lot of OPEN SOURCE FOR YOU  | MARCH 2013  |  87


For U & Me

Review

time to get familiar development tools ported to ARM. Some of the best feedback we have had from developers and testers is that they didn't even realise they were running on ARM hardware,” explains Power. Intel is also talking of a 6W processor for servers now, so how would ARM fare compared to that? While Intel’s move is a clear acknowledgement of the need for low-power servers, there is still a lot to be done before Intel’s 6W processor can compare with a 5W server. Viridis is a 5W server, which includes all the components required for operation in a data centre (power measured at the wall, including motherboard, network, cooling fans, memory, disk, etc). “When you add all such factors to Intel’s processor, it will be significantly higher than 5W. Intel will undoubtedly introduce a SoC product down the line, but at that point we expect to have Viridis v2 (or possibly v3) ready for the market, which will have further performance/watt improvements,” says Power. Others also appear to be in favour of ARM at present. Dell announced the Copper platform in May 2012. This is a platform based on an ARM-powered SoC from Marvell. Mitac in Taiwan also announced and demonstrated a Marvell-powered server at Computex in June 2012. HP has shipped a number of Calxedabased development platforms (called Redstone) to enable companies to start porting and evaluating the benefit of ARMbased server technology for their applications. A US company called Penguin Computing, focused on data analytics platforms, is also shipping a Calxeda-powered platform. Dell has announced a programme called Iron, using a 64-bit server SoC device from Applied Micro, which is likely to ship later this year.

Go, go, Linux!

Boston has adopted the best of Linux technologies. It is using Canonical's Ubuntu 12.10 and Red Hat's Fedora 17 development releases on Viridis, because these flavours apparently have very good support for Calxeda’s version of ARM SoCs. The other ARM-based server products from Dell, HP and Mitac are also Linux-based. Ganesan says, “Hardware is irrelevant without software. The data-centre companies are focused on leveraging open source software as broadly as possible, and so is the software strategy provided alongside Viridis. ARM and Calxeda have been working for multiple years to ready Linux distributions for the EnergyCore device.” “Linux was always our No 1 choice for OS, and it had to be that way,” boasts Power! The majority of the WWW infrastructure is running some variant of a LAMP stack (http:// news.netcraft.com/archives/category/web-server-survey/). Most of the world’s clouds and cloud infrastructures are running Linux, with OpenStack being a good example. In the HPC space too, over 93 per cent of the world’s most powerful supercomputers are also running Linux (http://www.top500.org/statistics/list/). Finally, the ‘Big Data’ space, which is dominated by Hadoop and Hadoop derivatives, is running Linux! With these being the main focus areas for Viridis, Linux was a de-facto choice!

By: Janani Gopalakrishnan Vikram The author is a technically-qualified freelance writer, editor and hands-on mom based in Chennai.

Continued from page 85... The same group has a newly born ‘National Software Platform’ initiative, which was formed last summer. The objectives of this initiative were declared to be too broad— ranging from the creation of a national Linux distribution (another one, in addition to existing MCBC and AltLinux?) to setting up the policy on how to use (F)OSS within the government sector. It’s hard to believe this national platform will be effective, because the participants are the same RASPO mentioned earlier, plus a number of non-profit enterprises and several government research institutions. Will it be able to make another corporate Russian distribution? Probably, it will. But what about a stable and strong community? This question still remains open. At the moment, higher efficiency is shown by the middle-size private companies, which can create the finest products compared to those from state-owned enterprises. Miracle? Yes, it’s true. Russia ignites technologies and specialists born to be professionals in Linux, but is unable to create one unified atmosphere for greater Linux government adoption—in schools, universities and within the government itself. P.S. A small update: In September, the AltLinux company announced its withdrawal from the RASPO board. Either this decision was connected to fundamental differences between RASPO members, or the company decided to focus on Linux 88  |  March 2013  |  OPEN SOURCE FOR YOU

and not to disperse its efforts onto different initiatives—this is still unclear. Anyway, time will show who was right. And in August 2011, Red Hat opened its Moscow office. Although it doesn’t yet plan to bring in development resources, no one can predict exactly how this will affect the corporate Linux sector in Russia. In general, we note just one thing: the current state of Linux in the local market reminds us of chaos. Amazingly, there’s always something new that’s born out of such chaos! References [1] http://en.wikipedia.org/wiki/Unix_philosophy [2] http://www.altlinux.com/ [3] http://en.wikipedia.org/wiki/SWsoft [4] http://en.wikipedia.org/wiki/OpenVZ [5] http://www.rosalab.ru/ [6] http://www.calculate-linux.org [7] http://www.yandex.com/

By: Anton Borisov The author has specialised in Linux and FOSS technologies for more than a decade. His professional spheres of interest include, but are not limited to, robotics, embedded systems, statistics and algorithmic methods.


Interview

For U & Me

If you start looking to the community for support, there would be no innovation Bruno Georges, director, software engineering, Enterprise Application Platforms, Red Hat Asia Pacific Pte Ltd

A majority of the users of open source products feel that their technical concerns should be addressed by the community. This may or may not happen. The idea behind having a community is to foster innovation and not just provide support. Diksha P Gupta from Open Source For You visited JUDCON 2013 and spoke to the developers. Bruno Georges, director, software engineering, Enterprise Application Platforms, Red Hat Asia Pacific Pte Ltd and Arun Kumar, general manager, Red Hat India, aired their concerns in an exclusive tête-à-tête. Read on...

Q

What is different in JUDCON 2013, compared to 2012?

Bruno: Not just in India but globally, JUDCON 2013 has been very well received this year. We saw increased participation not only in terms of numbers but also in terms of the sharing that happened during the sessions. People were not busy using their laptops but were actually attentive towards the speakers. This, according to me, is a major

change in JUDCON 2013 as compared to the last year. In India, the participants want to know more about the current trends in Java and where it’s heading.

Q

Have the awareness levels changed, reflected in the questions that you have had to face from the audiences?

Bruno: A lot has changed in this regard too. This time at OPEN SOURCE FOR YOU  | MARCH 2013  |  89


For U & Me

Interview

JUDCON, we talked about some newer technologies and we find that participants are interested in knowing the technologies in detail. We discussed technologies like the cloud and how it is being used across the globe. We have talked about being cloud-ready from the very beginning, in terms of footprints, energy consumption, etc. It’s good to see questions around these from the audience. In India, a large number of people are updated about technology and we had some really intelligent questions coming our way. We got to know some interesting facts about the audience here. Bengaluru is No 1 in terms of using the technology. It’s not just about continuing with the old technologies but also adopting the new ones. So on all these fronts, JUDCON India is a unique event.

Q

You have JUDCON events globally. Which of the lot is the best and why?

Bruno: The best depends on both the speakers' perspective and the attendees’ perspective. We have JUDCON in USA, Germany, China, India and many other countries. The rest of the JUDCONs are pretty local but the Indian edition of the event is a bit different as it caters to both the global as well as the local audience. Obviously, there are a large number of local customers, SIs and students. It was a wide spectrum of attendees that we saw but the reason I say that JUDCON India has a global impact is because it is huge in its size and the people who attend the sessions take away a lot for their customers. That's a unique differentiator for JUDCON India.

Q

Sure, but I could see a lot of students around as well. What is the point of having students when it is such a high-level technology event? Arun: You will be amazed at the level of open source education happening in this country. Java is taught in almost every institution. I have spoken to a lot of people who vouch for the fact that Linux and Java are taught in most of the Computer Science degree courses. In India, even people doing Electronics Engineering end up taking Linux or Java. So, for people who are spending their time and energy in understanding open source, such an event is an extension of that. Even in FUDCon we see enormous participation from people in education institutions. They are using Linux, which is a great operating system to teach at college because its source code is free. When I did my engineering, we only talked about device drivers. It was all theory. I could not look at the device driver code because there was no open source device back then. Things have changed drastically now and one can see the code to understand the concepts better. Apart from that, there is a demand from the academia that we should interact more with students to give them the real picture. So, it’s not just restricted to the conference but goes beyond it. The students want to know the technicalities and want to add those details in their resumes as well. That is how they

90  |  march 2013  |  OPEN SOURCE FOR YOU

"You will be amazed at the level of open source education happening in this country. Java is taught in almost every institution. I have spoken to a lot of people who vouch for the fact that Linux and Java are taught in most of the Computer Science degree courses." look to market themselves. Think about it from the market perspective. Let’s look at the example of Sun Microsystems. The growth of Sun Microsystems was because of educational institutions. Students' participation is something that we welcome, and it’s a great thing for us as we catch them here and nurture them to create a good workforce.

Q

In one of your public speeches, you said you want to develop JBoss faster than the requirements change. How would you do that and what efforts have you made in that direction?

Bruno: We will develop reference architectures. We will develop tools that allow you to be proactive. Writing new code every time something changes is very cumbersome to me. So when you know the requirements, you go for different iterations. The requirements keep changing for many reasons, whether due to market changes or technological advances. So the lifecycle needs to be short. We know these paths and we work to shorten this path. Arun: It’s a function of automation. The biggest challenge for any software development organisation is how many times you reinvent the wheel. Any SI has to work to cut short the time for development, which has a direct impact on the ability of the business to respond to the market changes. India has a lot of regulation. So keeping in mind those regulation changes, we have to see how quickly we can adapt our applications to the changing environment. Think of customers in the insurance industry, who have to face a lot of regulatory changes. In that kind of environment, they have to be absolutely prepared for whatever changes that may come in. I think this is a new way of developing applications, which is far more agile and allows you to be more responsible as a business.

Q

One criticism that comes your way is that JBoss is still tagged as a 'vulnerable open source application'. How do you defend that? Bruno: Like any software, we also come across bugs but we fix them within no time. We have a mechanism in place as an enterprise to deliver the fixes to our customers. This is not restricted to just JBoss. This goes


Interview

For U & Me

and realised that we needed to make it secure, out of the box. Arun: Beyond this, the debate on whether open source software is secure or not has not stopped. But the fact remains that organisations do what they want. If indeed what you say is true and if indeed the FUD (Fear, Uncertainty and Doubt) that is spread is true, you won't have stock exchanges deploying this technology. A lot of reports point towards bugs in Java. That doesn't mean Java is inherently insecure. I think security is not just a function of technology, it’s a function of process, compliance and how well-structured you are to be able to handle that. JBoss, in particular, has some high level security certifications to its credit from authorities across the globe.

Q

OSFY spoke to a developer this morning. He was new to JBoss and he wanted some support and assistance. He tried writing to the community and to the company about it but he did not get any solution. He said he had difficulties with OS GI but since he did not get any response, he had to drop it...

Arun Kumar, general manager, Red Hat India

"A lot of reports point towards bugs in Java. That doesn't mean Java is inherently insecure. I think security is not just a function of technology, it’s a function of process, compliance and how well-structured you are to be able to handle that." out for all our solutions. So many years after launching, we are comfortable to say that JBoss is one of the best. It is not just about vulnerabilities, but about the ability to respond and fix them quickly when they are found. If you deep dive into the whole scenario, we have two types of users: one set wants ease of use and the other wants a stricter scenario from the beginning. We listened to those needs two years ago and we addressed the security issues right at the very beginning. We have learnt from the past when JBoss was too vulnerable because it was too open. That was the time when we got a hint about this problem

Arun: There is something called the Red Hat Price Subscription, which is precisely for this purpose. The community exists to give away their innovations and to help build a product. But it is not directly responsible for support. If every developer in this world starts looking at the open source community as a support forum, there will no development and innovation. Using the community to foster the innovation makes sense. The moment you cross the boundary regarding the extent of support you need, that is when you move from a community product to an enterprise product. Then, that support will come with a subscription model and the upgrades. If I look at it from the India perspective, I think it is fairly immature. We need to understand that the community is not there for support, but it is there to foster innovation and that is how it should be. This is a general problem in this part of the world. People in the other parts of the world are pretty clear that if it is a community product, then don't expect any support. They know that if they want any support, they have to move to an enterprise product. There you have companies like us offering support. We are available on call. The experts are there to answer your questions. OPEN SOURCE FOR YOU  | MARCH 2013  |  91


For U & Me

Let's Try

Use the Bench Calculator to Program Mathematics This third article in the mathematical journey through open source takes you through the functional power of the bench calculator.

A

fter going through basic programming on the bench calculator, it's time to explore its functional power. As mentioned earlier, you can do functions with the bench calculator (BC). Unlike C, it has built-in functions, where as standard math functions, and user-defined functions are similar to C.

Built-in functions

The BC’s built-in functions are: length(expr) – returns the number of significant digits in expr. read() – reads a number from standard input in the base dictated by the ibase variable. scale(expr) – returns the number of digits after the decimal point in expr. sqrt(expr) – returns the positive square root of expr, given that expr is non-negative. Here's a sample execution of the above functions: $ bc -ql length(000023.450) # Number of significant digits 5 92  |  March 2013  |  OPEN SOURCE For You

scale(000023.450) # Number of digits after the decimal 3 sqrt(2) # Square root of 2 1.41421356237309504880 sqrt(-1) # Square root of -1 is an error Runtime error (func=(main), adr=4): Square root of a negative number ibase=2 # Changing the input base to 2 x=read() # Wait to read the input in binary and then display 1100 # This is the input x # Display the read value in the default output base 10 12 quit # Get out

Wait! Are those all the built-in functions? What about the previously used print? In BC, print is not a function; the missing () indicates it is actually a statement, like if, for, ... and its syntax is print <list>, where <list> is a comma-separated list of strings and expressions. (If you have not yet got the hang of this word expression, it is a statement of numbers and variables operated with the various operators and functions.)


Let's Try Standard math functions

When BC is invoked with the -l option, the math library is also loaded, making available for use the following six math functions: s(x) – returns sine of x (x is radians) c(x) – returns cosine of x (x is radians) a(x) – returns arctangent (in radians) of x l(x) – returns the natural logarithm (base e) of x e(x) – returns the value of e raised to the power of x j(n, x) – Bessel function of integer order n of x All these functions operate with the scale dictated by the built-in variable scale, which is by default, set to 20. Here's a sample execution: $ bc -ql scale # Show the current scale 20 pi=4*a(1) # Calculate pi as tan-1(1) is pi / 4 pi # Show the value approx. to 20 decimals 3.14159265358979323844 s(pi/3) # Calculate sine of 60° - should sqrt(3)/2 .86602540378443864675 sqrt(3)/2 # value for comparison – note the approx. error .86602540378443864676 c(pi/3) # Calculate sine of 60° - should be 0.5 .50000000000000000001 l(1) # log(1) 0 e(1) # Value of e1 approx. to 20 decimals 2.71828182845904523536 quit

If all this sounds too geeky and mathematical, let's forget it, and do some simple stuff; let's write simple user-defined functions.

User-defined functions

Here is how you write a user-defined function (to add two numbers) in BC: $ bc -ql define add(x, y) { return (x + y) } add(3, add(4, 5)) # Lets add 3 with the sum of 4 & 5 12 quit

Given that, the factorial code from our previous learnings can be converted into a function as follows (say, in functions.bc): define factorial(n) { product = 1 for (current_num = 1; current_num <= n; current_num += 1)

For U & Me

{ product *= current_num } return product }

And then, you can use that function, as follows: $ bc -ql functions.bc # Load the functions while invoking bc factorial(10) # Compute the factorial of 10 3628800 quit

As you now have factorial, you can even calculate the series of e, i.e., 1 + 1/1! + 1/2! + ..., say up to 1/20 for a good enough approximation. Here's how it would go: $ bc -ql functions.bc exp=1 for (i = 1; i <= 20; i++) { exp += (1/factorial(i)) } exp # Display the computed value of e 2.71828182845904523525 e(1) # Compare with the standard math function 2.71828182845904523536 quit

And, as in C, if you need a function only to do actions and not return anything, void is the way: $ bc -ql define void designer_print(v) { print "---{", v, "}---" } designer_print(100) # Print 100 with the designs ---{100}--quit

Having covered the fundamentals of these functions in BC, we will dive into its recursive functional power in the next issue.

By: Anil Kumar Pugalia The author is an open source hardware and software hobbyist, with a passion for mathematics. His exploration with mathematics, in every aspect of life, dates back to the 1990s. A gold medalist from the Indian Institute of Science, mathematics and knowledge-sharing are two of his many passions. Apart from that, he experiments with Linux and embedded systems to share his learnings through his weekend workshops. Learn more about him and his experiments at http://sysplay.in. He can be reached at email@sarika-pugs.com.

OPEN SOURCE For You | March 2013  |  93


For U & Me

Open Strategy

Asus to Launch Wi-Fi Google Nexus 7 Tablet in India by June!

Google has been rolling out its Nexus smartphones and tablets in the global market, but the Indian market has still been left largely untapped. Well, things appear to be changing and Google's OEM partner, Asus, is looking to bring in the first Nexus device into India soon. Team OSFY spoke to Peter Chang, the newly appointed country manager of Asus, about the launch of Nexus devices in India, the firm’s strategy around Android, and much more. Read on... Peter Chang, country manager, Asus

Q

Q

It is totally Google's prerogative to choose its OEM partners. As you must have observed, it keeps the ball rolling. We have had a good relationship with the Android maker and we look forward to more such tie-ups.

We hope to continue with the push that we got from the Nexus brand. Asus made Nexus 7, which although not launched in India officially, has become a great success worldwide. We don’t know about the upcoming Nexus devices—whether we would make them or not—since Google has a multi-brand strategy with respect to its Nexus devices. In the future, we are

Asus is the first Google Nexus tablet maker. Google chose you for making the 17.7-cm (7-inch) device. Despite much success and worldwide acceptance of your tablet PC, Google chose Samsung for the 25.4-cm (10-inch) variant of the tablet. Any reasons?

94  | MARCH 2013  |  OPEN SOURCE FOR YOU

Do you think being the maker of a Nexus tablet adds to your existing reputation? How would you take advantage of the Nexus tag?


Open Strategy hopeful about getting the opportunity to make another Nexus device, as our Nexus 7 tablet has done very well.

Q

The Asus-Google Nexus 7 is available online in India at a price of Rs 19,999. Do you think the Nexus 7 is suited for the Indian market? A Nexus device offers a completely different experience from any other brand. The overall outlook of a Nexus device is way better than any other tablet in the market. In Europe, we are among the top three players due to Nexus 7. I don’t think there is any other product that can give an experience similar to that of the Nexus 7 at the same price point.

Q

So why has it not been officially launched in India yet, though anyone who wishes to can either buy it online or even at one of the stores in New Delhi? We are still working on the official launch of the device. We will keep the fans of Nexus updated about the official launch.

Q

On the connectivity front, the Nexus 7 is a ‘Wi-Fi only’ model, so the tablet may not be liked by many buyers in India as GSM connectivity in the form of dongles is more popular than Wi-Fi in the country. We are planning to launch the 3G version of the Nexus 7 in India.

Q Q

When can we expect the Nexus 7 3G to come to India? Hopefully, we will launch the tablet by the first half of 2013.

At what price will it be available here?

Pricing is yet to be worked out. Looking at the market of a 17.7-cm (7-inch) tablet in India, the price could be roughly around Rs 20,000.

Q

What are the key things you look for before launching a product in the Indian market?

Product-wise, we try to launch the devices in India shortly after launching them globally. In India, the premium sales do exist, but we also try to keep our focus on value for money. We have a lot of products in India, which offer good value for the money spent. Even in the low end segment, we prioritise on the designs of the product. The Indian market is different just because Indians really research a lot about a product before buying it, which, in a way, is good for us as they will understand Asus better.

Q

Android has been around for a long time. But now you have more open source operating systems to explore, including Ubuntu’s and the Firefox operating system for smartphones. Do you feel there is enough potential in the newly launched operating systems? It’s too early to talk about these operating systems. They have just been launched. We will have to wait and watch out for further developments. But at the moment, we would be focusing on Android for our products. We don’t have any plans to work on Firefox or Ubuntu, as of now.

For U & Me

"The Indian market is different just because Indians really research a lot about a product before buying it, which, in a way, is good for us as they will understand Asus better."

Q

You are expanding your retail presence by opening stores across India at a very fast pace. What is the strategy behind such rapid launches of Asus stores across Tier I, II and III towns in India? Since the last two years, we have always been focused on coming up with new stores because we believe a channel is very important if you want to grow in India. Even in 2013, we will continue to expand our channels in the country. We want to have 200 Asus stores across India by the end of 2013. As the consumer awareness is growing, consumers in Tier III or Tier IV cities in India are learning about Asus. Brand consciousness is slowly growing in rural areas as well. So, people want to feel the difference in a branded product, which makes the presence of physical stores very important. Also, after sales service is a very important factor, which is associated with branding. So, our stores will help in reaching out to more people. Thus, a store is an ideal marketing tool. Asus is becoming popular in smaller cities and towns across India. We are getting more sales from Tier II and Tier III cities across the country than metro cities. Places like Hubli in Karnataka and Durgapur in West Bengal have amazed us with high sales figures. We, at Asus, are observing that the Tier II and III cities are slowly leading in sales of tablets as compared to their urban counterparts.

Q

Yet another much-talked about device from Asus is Padfone. It’s a phone-cum-tablet-cum-laptop. But if you look at it as an individual product, it is just a phone, which can power a bigger screen if fitted into it and can support a keyboard too. So the tablet part doesn't work without the phone being inserted in it. What is the strategy behind designing a product like Padfone? At Asus, we take design and innovation seriously. We like to experiment with new types of products and see how the market responds to it. The idea behind launching Padfone is to cater to the people who want a good smartphone as well as a tablet in a single device. The device is meant for those people who want to have the experience of a smartphone on a large screen. For example, when you are travelling, if you carry the Padfone, then you just have to plug in the device to the supplied display screen to enjoy movies or work on a large screen. Also, we wanted to come up with a completely different kind of hybrid product.

Q

When can we expect the Padfone 2 smartphone-cumtablet in India?

We had launched the original Padfone in India last year. Mobile phone is a new product for us. So, our idea is to open the channel with Padfone first, and then expand our

Continued on page 99...

OPEN SOURCE FOR YOU  | MARCH 2013  |  95


For U & Me

Career

Chart a Successful, RecessionProof Career in Virtualisation While the virtualisation job market is expected to be buoyant for many years, the demand for well-trained professionals in this fast-evolving terrain is only going to increase. This article looks a little closer at the career prospects in this field.

A

s the globe wrestles with a plummeting economy, organisations are looking to technologies like virtualisation to optimise their IT resources and scale down infrastructure costs. Whether it’s for storage or servers, the desktop or for networks, Indian enterprises, too, have realised the effectiveness of this emerging technology and are increasingly turning to virtualisation. Not surprisingly, virtualisation is growing at a fast clip with an accompanying need for experts in this domain to meet the industry demand. Various recent studies also indicate that IT professionals armed with virtualisation skills are among the most sought-after employees. With virtualisation promising to offer strong career prospects

96  |  MARCH 2013  |  OPEN SOURCE FOR YOU

for years to come, the OSFY team interacted with the industry leaders to get an insight into what it takes to make a career in this hot arena. At a time when the recruitment market does not seem to be too buoyant, it becomes important to grab the attention of HR managers. And a bagful of natty virtualisation skills can help one get noticed, even in the sluggish economy, believes Ankit Oberoi, co-founder and managing director of Innobuzz Knowledge Solutions, New Delhi. “What makes virtualisation hot as a trend is the fact that it helps lower the operating costs and offers many benefits. For example, server virtualisation rules out the need for numerous physical servers, which would not only


Career be more uneconomical, but will also require more space and the use of more resources. Naturally, the demand for virtualisation professionals is high and there is a shortage of dexterous IT professionals in this domain. This is definitely a perfect time for interested candidates to cash in on this opportunity,” says Oberoi. The scope of a career in this terrain is immense. Interested candidates can choose between storage, network, desktop and application virtualisation. Explains Ravinder Kumar, technical manager for virtualisation, Koenig Solutions, New Delhi, “The areas where one can make a career in virtualisation are in software development, systems administration, quality engineering, systems support, marketing and more. Systems or virtualisation administrators manage applications, and monitor how these applications work together in a virtualised environment; quality engineers test desktop virtualisation software, and kernel developers play a key role in advancing the technology. With actualisation becoming mainstream, the conventional IT roles too have undergone a sea change, with recruiters looking for candidates proficient in virtualisation.” While enterprises are increasingly leaning towards virtualisation to leverage their IT resources, it is important to understand the skillsets one needs to have to match the demand. Tuhin Sinha, owner and CTO of the Academy of Engineering and Management, Kolkata (AEM), shares, “The skillsets vary and depend on what domain of virtualisation one wants to get into – development, support, services or marketing. The basic requirement is to have knowledge of the systems for software development careers in this spectrum. A basic knowledge of the Linux kernel,

accompanied with skills in C and C++, will boost employability. In a nutshell, virtualisation professionals will do well if they are highly proficient in operating systems, storage, networking, security, etc.” And do certifications in this domain shore up one’s career prospects? “Certifications, though not mandatory, definitely boost one’s employability in the virtualisation domain and give candidates that extra edge over their non-certified counterparts during the hiring process. But only certification from a reputed firm or authority will make a difference. After all, what matters is the sound technical skill base of a professional,” adds Sinha. Industry stalwarts claim that as virtualisation is a revolutionary model, it has made steady inroads into the open source ecosystem, too, thus opening a slew of opportunities for IT professionals. Alok Srivastava, chief executive officer and founder of Network NUTS, New Delhi, opines, “Earlier, companies did not have much choice and they resorted to proprietary virtualisation solutions. Now, with an upbeat open source virtualisation ecosystem, large businesses are heavily relying on open source for economic advantages. A few enterprises in Hyderabad are planning to migrate their servers to Red Hat. The bigger the size of the companies, the more number of servers will be based on open source. Naturally, the demand for open source professionals becomes high. In our institute, we do receive requests from various companies to provide training to their employees on Red Hat Linux Certification.” So, if you wish to give a fillip to your employability chances, a career in virtualisation is just for you!

By Priyanka Sarkar The author is a member of the editorial team. She loves to weave in and out the little nuances of life and scribble her thoughts and experiences in her personal blog.

For U & Me

Winner of Best Redhat Training Partner Award since 2005

Redhat Training & Global Certification

Students Placed in Wipro, HP, IBM, TCS, Tripod, Comtel, Daidem, PCS, CMS, Redhat & Many More.....

KOLKATA 2/80, Dum Dum Road, 1st & 2nd Floor, Kol - 74 Contact : 9830075018 / 9830051236 visit us at : www.aemk.org

OPEN SOURCE FOR YOU  | MARCH 2013  |  97


For U & Me

Interview

Open source technology will bring in a services-based model with a reasonable opex and zero capex myOpenSourceStore. com is an open source solutions provider catering to businesses worldwide. Devasia Kurian, managing drector, myOpenSourceStore. com interacted with Ashwin Gopinath of OSFY about the reason behind starting the online open source portal and what it means for the future of open source in India.

Devasia Kurian, managing drector, myOpenSourceStore.com

W

hat is happening with open source technology w.r.t. businesses and organisations?

The adoption rate is low in comparison with proprietary alternatives; but there is pressure on enterprises to meet customer requirements with fewer resources and to find cost-effective solutions with a quick ROI. So the use of open source technology is increasing. OSS facilitates the preservation of a wide range of information for future developments and it comes with considerable financial savings. Government institutes and PSUs are looking forward to more adoption and implementation of OSS in their IT infrastructure. The increasing awareness of open source in the public and government sector has been one of the significant developments in IT technology.

Q

How is open source affecting the commercial software business model?

As we know, a liberal licensing policy makes open source software accessible free of charge, along with the source code, which can then be customised by the user as per requirements. This drastically reduces costs, ensures less vendor dependence, reduces piracy/copyright infringements and increases the growth of a knowledge-based society. The key advantages open source offers are: no vendor lock-in, abundant support, simple licence management, cost effectiveness and easy customisation. Open source technology will revolutionise the current 98  |  MARCH 2013  |  OPEN SOURCE FOR YOU

software business model by replacing the existing software vendors who deploy a large capex-based model. Open source technology will bring in a services-based model with a reasonable opex and zero capex. The industry will welcome this movement whole-heartedly.

Q

What are some of the considerations for a company deciding to move over to the open source side?

Before a company decides to adopt and implement open source technology in a system, it needs to understand the long-term implication on the business. Since the decision to shift to open source is a long-term objective and incurs costs, the company needs to evaluate multiple factors. Some of them are: Does the software offer sufficient features for the near future? Will it scale up based on the organisation’s requirements? Is there adequate documentation on installation, configuration and trouble shooting? Will the service provider offer support on installation, configuration and maintenance, and… Is there a large online community supporting the software?

Q

Does the open source approach have any drawbacks for organisations?

Though open source software is free software, which can be modified, customised and is cost effective, there are certain limitations.


Interview Many developments in the OSS world occur very fast, almost at the same time. It is hard to keep track of which one is the latest version of a particular software. In most cases, there is no proper support service for installation, configuration or troubleshooting. There is also the risk of open source software stagnating, due to developer distraction or the loss of motivation and resources.

Q

What are the problems impeding the widespread adoption of open source technologies?

As we see it, even though open source comes with cost and scalability advantages, the adoption level is low. Awareness and support are two key issues which have to be tackled. It is easy to download software for free, but that requires support in terms of seamless installation and implementation. We should, therefore, provide support to enterprises, right from product selection and installation configuration to maintenance (all on one platform), thereby accelerating the adoption of open source technology.

Q

What measures do you think should be taken to drive up the adoption rate of open source?

First, open source adoption has to be a part of an organisation’s and CIO’s IT strategy. Second, one has to select the right set of resources. The companies have to work towards creating an end-to-end solution comprising product selection, and support for installation and maintenance. It

For U & Me

"It is important to know how open source software will be used within the business environment in terms of professional implementation and has to be viewed with a clear focus." is important to know how open source software will be used within the business environment in terms of professional implementation and has to be viewed with a clear focus.

Q

What has the Indian community’s response been to accepting open source technologies and software?

The open source community in India is one of the largest in the world. As the market is maturing, organisations in India have slowly started accepting the advantages of open source platforms and encouraging collaboration. Open standards is a key facilitator for customisation and innovation, and the Indian developer community is creating OSS for a wide range of applications. With the increasing adoption of business applications by the Indian small and medium businesses, and cost being a key constraint in the adoption of applications development tools, open source solutions offer an interesting alternative. Government institutions and PSUs are in discussions regarding the adoption of open source software, e.g., the Indian Railways is supporting the deployment of Asterisk, an open source telephony platform, for all new developments in internal telephone services.

Continued from page 95... channel with Padfone 2. Due to the innovative design of the Padfone, the product cycle is a little bit longer. Also, people need time to understand the two-in-one feature of the Padfone device. This is the main reason for the delay in the launch of Padfone 2 in India.

Q

Asus is looking forward to launching the low-end MemoPad 7 tablet in India. Do you think there is enough scope in the low-end tablet market in India? Primarily, what we have seen from the other players in the lowend Indian tablet market is that there is actually huge potential. The local tablet brands have helped us by introducing tablets to Indians beforehand. We believe that the local brands have initiated the trend and have also developed the initial demand in the Indian market. After the initial market is created, people would want to have better products. The tablet market will keep on growing from here, and we believe there is enough potential for Asus. Where notebooks took around a decade to develop the market, tablets will take just three years.

Q

What kind of response have you observed in India with respect to tablet PCs?

In India, last year saw the tablet business start off. We believe around 2 million tablet units were sold in India in 2012. This year, we can expect the sales to increase greatly,

as big brands are slowly entering the market. Previously, tablets were sold in the mobile shops. In 2013, the IT channel will also rush to get tablets.

Q

Recently, Acer launched its Iconia B1 tablet under the sub-10k category. What are the key challenges for Asus in launching a tablet in the low-end market? Our team at Asus is trying to figure out the major challenges related to budget devices in the Indian market. Meanwhile, we are observing the experience of other brands. Also, we don’t want to compromise on the product’s features and the quality. So, having a product with a good design and features, while at the same time keeping the price low, is a major challenge for Asus. We are reviewing all the possibilities of launching a good product at a decent price.

Q

How is Asus planning to market its upcoming Androidbased devices in the Indian market?

The mobile device segment has changed its course, and is more like a convergence of the tablet and the smartphone. So, it’s hard to predict what the end users will want in their devices. At Asus, we try to focus on the entire product line up. We are trying to bring the best out of the innovations in the tablet market, and hope that people will like the quality being offered to them from a brand. OPEN SOURCE FOR YOU  | MARCH 2013  |  99


Admin

Insight

For SMBs, Virtualisation is the Way to Go! The virtualisation market has gradually matured over the past few years, with most enterprises adopting it today. And now, SMBs too are switching to it, on a large scale.

V

irtualisation has become almost mandatory for all companies deploying IT solutions in any way. It simplifies one’s IT infrastructure, creating a more dynamic and flexible set-up. As B S Nagarajan, director, System Engineering, VMware India & SAARC, rightly puts it, “Virtualisation makes your IT infrastructure simpler and more efficient. With virtualisation solutions, applications get deployed faster, performance and availability soar, and operations become automated, resulting in IT that’s easier and less costly to own and manage.”

100  |  March 2013 | OPEN SOURCE FOR YOU

Needless to say, virtualisation is currently the norm for modern-day IT infrastructure. Kashish Karnick, brand manager, IBM BladeCenter, India and South Asia, says, “Virtualisation is changing the way people work. It allows customers to consolidate their workloads on to a fewer number of hardware systems. It is possibly one of the most important aspects in today’s IT world. It has led to an absolute overhaul of the computing industry. The awareness about virtualisation is growing and people are aware about the advantages it provides.”


Insight The latest trends in virtualisation

Increased percentage of virtualised workloads: One of the trends that the Indian virtualisation industry is witnessing is the increasing workload that customers are virtualising. Nagarajan says, “I have been around in this industry for quite some time now, from the days when we had to literally struggle to make customers aware about the benefits of virtualisation. From such a scenario, we moved to a phase when customers started virtualising a few workloads for test and development; and today, I am glad to share that we have customers who have virtualised all the way from 50 per cent to around 80-90 per cent of their data centres. In fact, there are a few customers who are 99-100 per cent virtualised. The trend we are seeing is that customers are comfortable increasing the percentage of workloads that are virtualised.” Business-critical applications go the virtualisation way: Bhaskar Jayakrishnan, director, Software Development, Computing Systems Product Group, Cisco, talks of the virtualisation trends in the domain of business critical applications. He says, “The other trend that we are observing (which is also the reason behind the emergence of the first trend) is the virtualisation of business critical applications. Gone are the days when customers would virtualise only those applications that are less critical. The companies used to virtualise only the applications that IT was very confident about. They never touched the applications owned by businesses, like ERP and mail messaging. “Some of these applications are extremely critical to organisations and they were not virtualised a few years ago. But now a number of customers are coming forward to virtualise their business critical applications like SAP, Oracle Business Suite, etc. There were never any security-related fears for these applications. Organisations worried about whether the critical application would run the same way on a virtual platform as it did on a physical platform, and whether its performance would suffer. We have addressed most of these concerns now, and there are enough ways to prove that your performance is not going down. You get the same performance and, in some cases, it is even better—if you make the best use of the platform. Most vendors today are virtualisation friendly.” Migration of workloads from UNIX to x86 environments: Arun Kumar, general manager, Red Hat India, says, “India is a UNIX rich country, in the sense that we have a lot of UNIX deployments in India, compared to other countries. These days, we are seeing a number of customers (thanks to the high cost of maintenance, growing complexity, and so on) trying to move away from their legacy UNIX environments to the x86 environment.”

SMBs are getting virtualisation-friendly

Most companies offering virtualisation solutions have

Admin

customised offerings for SMBs. In fact, this is a very important segment for a majority of companies. Nagarajan emphasises, “Virtualisation in the world of SMBs is growing by leaps and bounds. This sector will continue to be our focus area this year as well. Some of our offerings are strictly dedicated to SMBs, and we are constantly trying to make them more affordable. The word SMB implies different things to different companies but for VMware, SMBs are companies that are not necessarily small but whose IT infrastructure may be small or medium—for instance, a large textile firm could have a large business volume, but we might classify it as an SMB from the IT infrastructure point of view. There is a lot of traction amongst the SMBs and SMEs for virtualisation. Let me give you an example. Disaster Recovery (DR) is generally associated with large customers with big data centres. Not many small companies go beyond a certain point when it comes to scaling up their IT infrastructure, as it is expensive and complex. But we all know that IT is critical for any company, whether it is small or big. A lot of small companies were not able to afford the expensive DR solutions previously. So starting this year, we have included the replication part which is used for DR as a free component in our existing licences. As a result, even SMB customers will be able to replicate their data and servers from one location to the other. So this is just one example. “The other important example revolves around backups, which are critical to every customer, be it an SMB or an enterprise. So we have included a back-up solution in our licences, free of cost. This is an issue that every SMB faces. They are not able to afford more expensive back-up software, so a part of the back-up solution is included in our package,” he adds. So the belief that virtualisation is not meant for SMBs and is only for bigger companies is gradually fading away. Karnick adds, “First of all, nobody implements a technology just for the sake of it. People implement technologies to address their business problems. Most customers spend a majority of their time and budget in solving their existing problems, which leaves them with very little time and money to focus on newer innovations that can help them grow. Typically, the function of IT is to keep things moving. Thankfully, due to virtualisation, a lot of these problems are resolved and the IT team is now able to think beyond the regular issues and take a step ahead in the direction of innovation.” By: Diksha P Gupta The author is assistant editor at EFY.

OPEN SOURCE FOR YOU | March 2013  |  101


For U & Me

Case Study

How OSS Helped a Construction Company Almost Halve its IT Budget! SEW Infra has been able to save nearly 40 per cent of its IT budget by deploying open source solutions.

O

pen Source India 2012 attracted a diverse audience. Techies from all parts of the world came to the convention to share and understand the latest in open source technology. But it was Shivaram Yeruva, from the construction industry, who presented a most interesting case study. This IT infra lead of SEW Infrastructure narrated a success story about how open source technology not only helped him cut costs but also win over his colleagues to the OSS cause. SEW Infrastructure Limited (www.sewinfrastructure. com) was founded in 1959, and is currently headquartered at Hyderabad in India. The company is one of the largest civil infrastructure-engineering majors in the country. 102  |  March 2013  |  OPEN SOURCE FOR YOU

The company has several projects across India and Africa

Shivaram Yeruva narrates, “When I joined SEW Infrastructure Ltd in September 2008, the company was in the middle of the Oracle ERP implementation. The initial part of my role was to set up a data centre at the SEW office to host the production class servers. The goal was to enable speed and flexibility in server provisioning while containing the costs. We looked into setting up the entire environment in a virtual environment. Part of the challenge was that Oracle EBS was not yet certified to be hosted on virtual servers. With the support of the management, I risked going for a virtual environment since the application was still under development. We


Case Study looked into several options available in the market, but settled for XEN virtualisation, which is under GPL and is an open source platform. “Over the next few months, the environment not only proved to be absolutely stable but also offered the flexibility required for rapid cloning, backup, server to server migration. The fact that the servers were virtual made no difference to the Oracle EBS application and database admins. We deployed our entire data centre on open source by using XEN virtualisation, iptables as firewall, Snort as the Intrusion Detection System, Squid as the Internet filter/proxy, Nagios as the network and device monitoring system, and Zci and OCS for asset management. “SEW’s construction sites are spread across the length and breadth of the nation, with some of them located in hard to reach places such as Arunachal Pradesh and North Sikkim. Our employees had to trek several kilometres to make a phone call and get in touch with the head office. We set up a nationwide VoIP infrastructure on Asterisk running in the XEN environment that handles more than half a million minutes of voice calls per year.”

The challenges were many

Shivaram’s belief in open source technology drove him to convince more and more colleagues in the industry about its benefits. He reminisces, “While we were discussing our ERP deployment on open source, the management was concerned about the post ‘go-live’ support. The ERP implementation partner recommended against virtualisation since it was not supported by Oracle at that point of time. Since we were still in the ‘development’ mode, we went ahead and took that risk. We were cautioned that it was not a standard procedure or a good practice. Our CIO, Sidhartha Meka, supported us by trusting our technical expertise.” At the end of the day, it appears that what is required is conviction and the technical knowhow. Things fall in place if these two are perfectly aligned. Eventually, when the application was finally ready for production level deployment, Oracle EBS was certified on Oracle’s VM. Today, when he looks back, Shivaram feels good about the fact that he could continue with his passion for open source technology, while benefiting the company. He says, “Being a non-IT company, we always have budget limitations for IT infrastructure – which was yet another reason to implement open source apps, apart from my passion for open source technology. When we went on to search for the appropriate open source software for our company, we found quite a few alternatives. The beauty of open source is that it allows complete flexibility and one can do modifications as

For U & Me

per the requirements. We found it easier to manage after deployment, as we could get immense support from the forums.” However, Shivaram's quest did not end here. He wanted to leverage open source tools to enable the end users as well. He says, “We have deployed Shivaram Yeruva, IT infra lead, many open source software SEW Infrastructure Ltd at the user level, which has helped in reducing our costs to a large extent. Earlier, we used to purchase office tools and PDF tools to convert the documents. But now, we are using OpenOffice and LibreOffice; we have many templates available for the same. We use DIA for flow charts or organisation charts. Gradually, we trained our employees to use Linux as their desktop OS. Initially, it was an uphill task, because they were used to Windows and breaking that mindset does take time. With some investment in training, and identifying and supporting the key change catalysts in the organisation, we are getting good results in the transition from Windows to Linux. After some initial hiccups, things have been smooth.” Shivaram explains that his job as an IT manager is to ensure the organisation’s growth, both technically and financially. Adoption of open source technology definitely required that extra bit of effort, but his conviction to make it was much bigger than the hurdles he faced. He summarizes his experience saying, “Go for open source and try it; later, you'll love the flexibility it offers. Modify it as per your needs and cut your capital expenditure. You will find new information on the forums every now and then that will help you enable innovative solutions. You will not be stuck with a vendor’s development and release cycles, and the frustration of dealing with its support processes for every issue.”

Flexibility, and freedom that is free of cost!

SEW has saved at least Rs 100 million by believing in open source solutions. Typically, provisioning of extra capacity and users requires lengthy budgetary approval processes that hamper business expansion. With open source this is hardly a challenge. Also, the use of open source architectures plants the organisation in an open standards oriented environment. This contrasts with the platformspecific dependencies on the vendors' proprietary technologies that are hard to migrate away from, and also require specialised skills to manage. By: Diksha P Gupta The author is assistant editor at EFY.

OPEN SOURCE FOR YOU  | MARCH 2013  |  103


Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP Parallels IBM

RedHat

Wipro Vmware Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP

A List Of Virtualisation Solutions Providers Cisco Systems | Bengaluru SONA, which includes Cisco Network Virtualisation, encompasses both a vision for the evolution of enterprise IT and a pathway to get there. Cisco differentiates itself from most other vendors by adopting a systems-level approach that integrates services throughout the infrastructure. Looking at the Cisco Catalyst switching portfolio, it becomes apparent that a wide range of Layer 3 switches support network virtualisation. Other vendors have point solutions that are only applicable for limited areas within the campus network. Cisco Network Virtualisation is a primary component of the Cisco SONA framework.

Citrix Systems | Bengaluru The desktop virtualisation system that centralises and delivers desktops to users anywhere, reduces desktop TCO by up to 40 per cent and improves data security by centralising desktop management. XenDesktop delivers a high definition user experience and personalised desktops over any connection.

Dell | Bengaluru

LEADING

The solutions from Dell can help provide a flexible infrastructure for the data centre by providing access to data for remote and mobile workforces using desktop virtualisation solutions. With virtualisation, you can count on an approach that meets your growing needs. It will increase an organisation’s ability to meet evolving business requirements by leveraging existing resources and scaling the infrastructure without the need to rip and replace. Dell focuses on standards-based solutions, keeping the barriers to change low. With Dell, you will not be locked into proprietary hardware implementations or management frameworks that may limit your options in the future.

Hitachi Data Systems | Mumbai Hitachi Virtual Storage Platform is the only 3D scaling storage platform designed for all data types. It is the only enterprise storage architecture that flexibly adapts for performance, capacity and multi-vendor storage. Combined with unique Hitachi Command Suite management software, it transforms the data centre.

HP India | Bengaluru The Client Virtualization Access Service of HP provides multiple network access, flexible role-based access, a userfriendly interface, and a secure printing network—all from a single access device. Using this unique technology as part of a client virtualisation solution, HP can provide a unique user-focused interface to internal, secure, partner, or cloud network resources—all from a variety of endpoint devices—ranging from desktops to tablets.

IBM | Bengaluru IBM Virtualisation provides a logical rather than physical view of data, computing power, storage capacity and other resources. IBM System Storage virtualisation helps provide centralised data management, reduced complexity, and reduced costs. The IBM SmartCloud Virtualized Server Recovery service can help reduce your recovery time and improve the reliability of your recovery infrastructure.

Intel | Bengaluru Hardware-based Intel Virtualization Technology (Intel VT)1 improves the fundamental flexibility and robustness of traditional software-based virtualisation solutions by accelerating key functions of the virtualised platform. This efficiency offers benefits to the IT, embedded developer and intelligent systems communities.

104  | march 2013 | OPEN SOURCE FOR YOU


Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco

Microland | Bengaluru

NetApp Oracle India PVT Ltd Netweb Technologies

Microland’s Desktop Virtualisation Business Value Assessment Service provides a holistic approach towards adopting desktop virtualisation adoption. By using this service, enterprises will understand the state of readiness of existing desktop infrastructure, the impact of desktop virtualisation on the organisation, the business case and ROI for a desktop virtualisation initiative, and obtain a high-level design road map for implementation.

HCL Technologies HP Parallels IBM

RedHat

Wipro Vmware Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland

MontaVista | Bengaluru MontaVista offers several virtualisation solutions, including KVM Hypervisor (full virtualisation), Linux Containers (OS resource virtualisation) and MontaVista Bare Metal Engine (OS resource virtualisation and SoC hardware optimisation).The company’s virtualisation solutions are certified by Linux Standard Base (LSB) 3.0, Carrier Grade Linux specification (CGL 5.0) and SCOPE Alliance Linux Profile 1.1. An impressive level of six nines (99.9999%) in reliability (a downtime of less than 31.5 sec/year) has also been proven by the company.

IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP

Novell India Pvt Ltd | Bengaluru Novell offers a wide range of best-in-breed and robust virtualisation solutions. Some of its key virtualisation solutions include the integrated Xen-based virtualisation solutions built on the capabilities of the SUSE Linux Enterprise Server, Kernel Virtual Machine (KVM), Linux Containers, Hyper-V as well as Windows guest support for KVM.

NetApp | Bengaluru With a NetApp agile data infrastructure, you can run mixed applications in a shared, virtual environment, achieve increased demand and unlimited scalability for your virtual servers, and optimise storage resources for greater efficiency, performance, ROI, and agility. You can also maintain continuous operations during updates, upgrades, and refreshes; and integrate data protection with zero performance impact and faster recovery.

Netweb Technologies | New Delhi Netweb Technologies provides server and desktop virtualisation to its customers. It is also active in the storage solutions and HPC space, and maintains around 5000 servers a year. The firm operates in six cities across India, and has a direct service and sales channel to the end customers.

Oracle India Pvt Ltd | Gurgaon Oracle offers the industry's most complete and integrated virtualisation, from the desktop to the data centre. Going far beyond simple consolidation, the company enables customers to virtualise and manage their full hardware and software stack. Designed for efficiency and optimised for performance, Oracle's server virtualisation products support x86 and SPARC architectures, as well as a variety of workloads such as Linux, Windows and Oracle Solaris.

Parallels | Seattle, USA Parallels uses its open source OpenVZ project as its commercial hosting product for Linux virtual private servers. High density and low cost are the two keywords you'll hear when experiencing a Parallels-based hosting solution. These are the two main reasons why the world's largest hosting companies choose Parallels. But, the innovation doesn't stop at Linux containerised virtual hosting. Parallels has also developed a containerised Windows platform to maximise the number of Windows hosts for a given amount of hardware.

Red Hat | Pune Red Hat Enterprise Virtualization is a complete virtualisation management solution for servers, powered by the people who brought you Red Hat Enterprise Linux. With Red Hat Enterprise Virtualization, you can maintain business continuity, to scale and integrate both Linux and Microsoft Windows workloads. Red Hat Enterprise

oPEN SOURCE FOR YOU | march 2013 | 105


Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP Parallels IBM

RedHat

Wipro Vmware Cisco Systems Citrix Systems Cisco Hitachi Data Systems Intel HP Microland IBM MontaVista Novell India Pvt Ltd Cisco NetApp Oracle India PVT Ltd Netweb Technologies HCL Technologies HP

Virtualization for Servers 3.1 is built on Red Hat Enterprise Linux, a platform trusted by thousands of organisations on millions of systems around the world for mission-critical workloads. It instantly delivers Microsoft Windows and Linux desktop operating environments to thousands of users from centrally managed servers in the data centre. It lets users remotely access their individual desktops from nearly any client device, including thin clients or re-purposed PCs. With Red Hat Enterprise Virtualization for desktops, you get cross-platform support and a great user experience with the freedom of an open source foundation.

VmWare | Bengaluru VMware virtualisation lets its clients run multiple operating systems and applications on a single computer, consolidate hardware to get vastly higher productivity from fewer servers, and save 50 per cent or more on overall IT costs. It also offers speed and simplifies IT management, maintenance, and the deployment of new applications.

Wipro | Bengaluru Wipro's Storage Virtualization Platform solution enables a virtualised platform for the development of storage applications like mirroring and de-duplication in an R&D set-up, thereby enabling easy debugging of the components. The storage virtualisation framework developed by Wipro is a convenient way to implement virtualisation applications without getting into the kernel and device driver intricacies. This easy-to-debug model provides a framework for easy testing of core algorithms.

Read Open Source For You: Asia’s Leading Open Source Magazine 106  | march 2013 | OPEN SOURCE FOR YOU



TIPS

&

TRICKS

How to check the date and time the system was rebooted

sudo kill “PID”

Here is a simple command to check the system’s reboot date and time:

…where PID is the process ID of Xorg. This will reload the XWindows System.

#last reboot reboot

system boot 2.6.18-53.el5

Note: You must have root access to use these commands

Sat Aug 6 18:02

(8+04:45)

—Indermohan Singh, indermohansinghk7@gmail.com

wtmp begins Sat Aug 6 18:02:07 2011

The command below will give you the date and time the system was booted: #who -b system boot 2011-08-24 09:43

—Sumit Chauhan, sumit1203@gmail.com

Reloading XWindows System

Sometimes, while working on a Linux-based computer, XWindows System doesn’t respond very well. Here are the steps to reload XWindows System in a non-responsive Ubuntu system. 1. First open the command mode by pressing: Ctrl + Alt + F2 …and then entering your username and password. 2. Then run the following command: top

Handling log files

As developers, we do a lot of testing after coding the software and we frequently need to handle the log files to identify the errors in the code of an application program. Given below are the steps to handle various log files that are being generated on a Linux system. 1. Clearing a log/text file:

The above command will clear all contents of the file. 2. To view the log/text file:

pgrep Xorg

“f”

108  |  march 2013 | OPEN SOURCE FOR YOU

$ tail -f filename

This command will display the file contents as and when the log is written. It also displays the flow of the log. 3. To use more sophisticated tools on log files:

Search the process named ‘Xorg’ in the list. If it does not appear, wait for a few seconds. Then find the PID of the ‘Xorg’ process, listed at the extreme left of the output on the top. You can also get the PID using the command given below:

3. Now run the following command to kill the Xorg process:

$ >filename

$ less filename

This will display the log file contents. You can also use the commands below while using less. a. To refresh the log automatically, press:

after issuing the less command.


b. To stop refreshing the logs, press:

Counting the number of files in a directory

Here is a simple command that can count the number of files in a directory (not the hidden ones):

CTRL + C echo * | wc -w

c. To scroll up, press:

—Anil Awasare, anil.awasare@gmail.com

w

Find and move files

d. To scroll down, press:

You can find and move files in two steps. Step 1 enables you to find all files with .mp3 as the file extension. In Step 2, you can move them. Step 1:

d

e. To exit the mode, press:

[narendra@ubuntu]$ find DIR_NAME -type f -iname “*.mp3”

CTRL+C

and then press

./dir2/f4.mp3 ./dir2/f3.mp3 ./dir1/f2.mp3

q

—Pranavam Siddharthan, pranavam.s@gmail.com

Changing file names from upper case to lower

To manually change the case (upper to lower or vice versa) of a large number of files can be tedious. So, here is a script that can make life easy:

#to change uppercase filenames to lowercase

Note: Replace DIR_NAME with your actual directory name. In the above example, you are only finding the files (that’s why you used -type f) that have extension ‘.mp3’. Now you can move these files by using the ‘-exec’ option of the ‘find’ command. Step 2:

#!/bin/sh if [ $# -eq 0 ] ; then

[narendra@ubuntu]$ find DIR_NAME -type f -iname “*.mp3” -exec

echo Usage: $0 Files

mv {} /tmp/mp3/ \;

exit 0

Here, ‘{}’ matches each filename which is found by the ‘find’ command. And ‘\;’ is used to indicate the end of the command. After executing this command, all mp3 files are moved into the ‘/tmp/mp3’ directory.

fi for f in $* ; do g=`echo $f | tr “[A-Z]” “[a-z]”` echo mv -i $f $g mv -i $f $g done

If you want to change the case from lower to upper, replace

—Narendra Kangralkar, narendrakangralkar@gmail.com

g=`echo $f | tr “[A-Z]” “[a-z]”`

with

Share Your Linux Recipes! g=`echo $f | tr “[a-z]” “[A-Z]”`

in the script. —Anil Awasare, anil.awasare@gmail.com

The joy of using Linux is in finding ways to get around problems—take them head on, defeat them! We invite you to share your tips and tricks with us for publication in OSFY so that they can reach a wider audience. Your tips could be related to administration, programming, troubleshooting or general tweaking. Submit them at www.linuxforu.com. The sender of each published tip will get a T-shirt.

OPEN SOURCE FOR YOU | march 2013  |  109


CALENDAR FOR-2013 eVENTS TO LOOK OUT FOR IN 2013 Date

Name of the event

description

location

website

5th – 6th Mar, 2013

The Mobile Strategy Summit

From identifying the building blocks for a successful Mobile strategy to understanding the power of analytical data from all the mobile sources, this summit has it all.

The Taj Mahal Hotel, New Delhi Contact: Kia Harry, Marketing Executive; +91 8105095358; kia.harry@ fleminggulf.com

http://www.fleminggulf.com/conferenceview/The-MobileStrategy-Summit/408

5th – 7th Mar, 2013

Gartner Symposium/ITxpo Dubai, U.A.E.

Industry's only event to deliver the insights, tools and relationships necessary to create, validate and execute transformative business technology strategies.

Madinat Jumeirah Hotel, Dubai, U.A.E.

http://www.gartner.com/ technology/symposium/ dubai/

6th – 10th May, 2013

Interop, Las Vegas

A place for thousands of information technology professionals to gather for networking.

Mandalay Bay, Las Vegas

http://www.interop.com/ lasvegas/

13th – 14th May, 2013

Gartner IT Infrastructure Operations & Data Center Summit

This Summit offers guidance on turning today's improvements in IT infrastructure and process efficiency into tomorrow's business advantage.

Grand Hyatt, Mumbai

http://www.gartner.com/ technology/summits/ apac/data-center-india/

23rd – 24th May, 2013

Cloud Connect

A focused conference that will bring together the entire ecosystem of the cloud.

NIMHANS Convention Center, Bengaluru

http://www.cloudconnectevent.in/

10th – 11th Jun, 2013

Gartner Business Intelligence & Information Management Summit

This summit provides Business Intelligence professionals and IT executives with world class research.

Grand Hyatt, Mumbai

http://www.gartner.com/ technology/summits/ apac/business-intelligence-india/

12th – 14th Jun,2013

The Global High on Cloud Summit

Through the Global High on Cloud Summit will address the issues, concerns, latest trends, new technology and upcoming innovations on the Cloud platform which will give an open forum and opportunity to everyone in the industry to come together and share their ideas & updates and provide a global outlook.

Mumbai Contact: Prashanth Nair; Sr. Conference Producer; Contact No.: +91-8041154921; E-mail ID : contactus@besummits. com

http://www.theglobalhighoncloudsummit. com/

18th – 21st Jun, 2013

CommunicAsia2013 / EnterpriseIT2013

Being the Asia’s largest integrated info communication technology event, it is instrumental in connecting the ICT industry.

Marina Bay Sands, Singapore

www.CommunicAsia. com & http://www.gotoenterpriseit.com/

30th Sep – 4th Oct, 2013

Interop, New York

Interop New York offers sessions and networking opportunities open to all attendees including Vendor Sessions, Cloud and Virtualization Theater Sessions, InteropNet tours and classes and Speed Networking.

Javits Center, New York

http://www.interop.com/ newyork/

21st – 23rd Oct, 2013

Gartner Symposium/ITxpo, Goa

The world's most important gathering of CIOs and senior IT executives.

Goa

N.A.

Open Source India

It is the premier Open Source conference in Asia targeted at nurturing and promoting the Open Source ecosystem in the subcontinent.

NIMHANS Convention Center, Bengaluru Contact: Atul Goel; Ph011-26810601/2/3; E-mail: osidays@efyindia.com

http://osidays.com/ osidays/

13th – 15th Nov, 2013

110  |  March 2013 | OPEN SOURCE FOR YOU



Mainstream Enterprise Adoption of Open Source Databases A conversation with Ed Boyajian, CEO, EnterpriseDB

Are enterprises embracing open source database software today? Absolutely. In 2012 we counted 32 of the Fortune 500 as customers and 47 of the Global 1000. That includes some of the biggest IT users in the world. IT operations at the Federal Aviation Administration, the US State Department, Fujitsu, Sony-Ericsson and Sony Online Entertainment are all using Postgres or Postgres Plus from EnterpriseDB. Interestingly, also noteworthy, companies like VMware, Microsoft (through its acquisition of Skype), Apple and Facebook (through its acquisition of Instagram) are using PostgreSQL. We are at the beginning of an explosion. Companies are finding that for a fraction of the cost of traditional databases, PostgreSQL can deliver the sophisticated features and capabilities they require. PostgreSQL has had decades of hardening and development by a talented and committed community of developers as well as a fast-growing, supportive ecosystem of database specialists.

How difficult is it to migrate to a new database? EnterpriseDB has developed a proven Oracle compatibility solution that enables our customers to run many Oracle applications using Postgres Plus. Postgres Plus natively supports many of Oracle’s system interfaces, facilitating migrations with minimal cost, risk and disruption. Existing technical staff – from developers to DBAs to operations teams – leverage existing Oracle skills to build and manage Postgres Plus databases. EnterpriseDB also has developed a comprehensive migration program that begins with an Oracle migration assessment and provides support and assistance with the process all the way through to deployment.

What happens after Postgres databases are deployed? Regardless of whether an organization is deploying applications based on community PostgreSQL or Postgres Plus, EnterpriseDB provides a portfolio of solutions that ensure success. We have made the long-term commitment to meeting the demands of the enterprise with Postgres-specialized products, Hurry! Offer expires September 30, 2012 support, and services. What’s more, we are continually developing new Postgres database enhancements and sponsoring the efforts of the PostgreSQL community. More than 2,000 organizations around the world turn to EnterpriseDB for Postgres-related products and services.

Contact us today about : • Software Subscriptions • Technical Support 24x7x365 • Migration Assessments • Training for Administrators and Developers • Professional Services * Call: +1 781-357-3390 or 1-877-377-4352 (US Only), Email: info@enterprisedb.com EnterpriseDB Software India Private Limited Unit # 3, Ground Floor, Godrej Castlemaine, Sassoon Road Pune – 411001

Test, develop and T deploy your application VMware vCloud powered cloud +91 20 3058 9500 Fon +91 20 3058 9502 www.enterprisedb.com Avail free cloud credit worth ` 25,000*, visit www.cloudinfinit.com for more details


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.