![](https://assets.isu.pub/document-structure/211012184157-d26059021e2bb894b5c34e587b6491a9/v1/febf5a3630e73595699d01a01b66c866.jpeg?width=720&quality=85%2C50)
19 minute read
Linux at Work
from n Source ...ber 2012
by Hiba Dweib
Open source software applications for the office that allow inter-operation and conversion, for those interested in using Linux at work.
Microsoft platforms (XP or one of the more recent releases) are ubiquitous in the workplace. Most organisations make it their Standard Operating Environment (SOE). Generally, the applications installed are also from Microsoft.
Advertisement
Much to the dismay of diehard Microsoft fans, some users have products from Apple, too, on their desktop. Typically, Apple provides the platform from which applications are launched, while they often also use Microsoft Office products like Word and Excel.
This article is not directed towards either of these types of users—unless they are considering a conversion.
It is often claimed that Linux cannot survive in the office environment because there are no compatible (or sufficiently compatible) applications. I beg to differ. What I am about to describe may not suit every class of user in every office, but I have found that I’m doing fine with Linux on my desktop at work, and no one (so far) is complaining.
So, what do I use?
Before I answer that question, I’ll provide a brief overview of what sorts of applications are necessary.
Applications in a Microsoft environment
I think these fall into two classes—applications that allow you to interoperate with your co-workers, and there are others which only affect you.
In the first category, for instance, is the ability to create or update a document. In the second, you run the application for yourself. Let me be more concrete. If someone sends me a Word document and expects me to make changes and send it back, the result of my efforts must be a Word document which my co-worker can read and modify. The modifications I make
should not gratuitously deform the document.
On the other hand, which browser I use does not affect anyone else.
In the following sections I will discuss the Linux applications I use that correspond to Word, Excel, Outlook and Lync. I’ll also discuss browsers.
The desktop
You need to understand a little about what my desktop runs to make sense of the sections that follow. I’m not recommending my choices, just providing context. For most readers, Ubuntu might provide a more familiar experience.
I always find that the Microsoft environment messes with my head. There is nothing I want less, nothing that would put me off more, than a Linux option which offered the Microsoft look and feel. But that’s just me. I’m not trying to convert anyone.
Currently, my machine at work runs CentOS 5.7. It also runs Fedora 16 under VMware Player (with Fedora as a virtual machine). CentOS gives me a conservative and stable platform for most of my work, but I also have access to reasonably leading-edge software under Fedora. To me, it feels like I’m running two computers, with some of my sessions in CentOS and others in Fedora.
It is unlikely that any of my readers use the windowing system I do, or have even heard of it: OLVWM (OPEN LOOK Virtual Window Manager). It has a look and feel that I have grown comfortable with over 10 years, and I see no point in changing. Fortunately, my choice of windowing system does not prevent you from running your preference.
Office products
For a near equivalent to Word or Excel, I use LibreOffice, a descendant of OpenOffice. “How near?” I hear you ask. Well, I have had no complaints. I don’t know how well LibreOffice handles Excel macros, but for the sort of spreadsheets I encounter, LibreOffice’s Calc module is excellent. For Word documents, LibreOffice’s Writer suits me, but I am more interested in content than presentation.
Importantly, LibreOffice lets you open Word and Excel documents, and to view them the way they were intended to look, or pretty close to it. If your work requires you to produce or work with Word documents where the presentation must be exactly right, Writer may not be for you. It’s possible that things have changed, but over many years, OpenOffice has often disappointed users when it came to the fine details. In which case, you might not be able to get away from Microsoft altogether. You might prefer to run XP as a virtual machine, and use Microsoft Word and Excel.
LibreOffice is readily available on Fedora. It is not available in standard YUM repositories in CentOS 5.7. It might be possible to get it to run, but I fear that it would jeopardise stability, so I’m not prepared to try. The URL is www.documentfoundation.org/develop Install the LibreOffice spreadsheet application with yum install libreoffice-calc.
The total download size is 142 M, and the installed size is 417 M. Install the LibreOffice word processor application with yum install libreoffice-writer. The total download size is 86 M.
Many sites use Microsoft Exchange as the mail server, with users running Outlook as their mail client. I’ve not tried it myself, but I believe Evolution provides compatibility with Exchange. You could also use OWA (a.k.a. Outlook Web Access), the Web interface to Outlook. For this, all you need is a browser. My solution is a combination. I use NMH (new MH message system) as my main email client. From Firefox, I use OWA to preview mail and to access calendars.
NMH (savannah.nongnu.org/projects/nmh) is an email system based on MH and is intended to be a (mostly) compatible drop-in replacement for MH. NMH isn’t a single comprehensive program. Instead, it consists of a number of fairly simple single-purpose programs for sending, receiving, saving, retrieving and otherwise manipulating email messages. You can freely intersperse nmh commands with other shell commands, or write custom scripts that use nmh commands. If you want to use nmh as a true email user agent, you’ll need to also install exmh to provide a user interface for it—nmh only has a command-line interface. Install it with yum install nmh. The total download size is 862 k, and installed size is 4.2 M.
In the unlikely event that you want to use NMH, you’ll need getmail to retrieve messages from Exchange using IMAP. Getmail (pyropus.ca/software/getmail/) is intended as a simple replacement for Fetchmail for those who do not need its sundry configuration options, complexities and bugs. It retrieves mail from one or more POP3 servers for one or more email accounts, and reliably delivers into a Maildir specified on a per-account basis. It can also deliver into mbox files, although this should not be attempted over NFS. Getmail is written entirely in Python. Install it with yum install getmail. The total download size is 174 k, while the installed size is 838 k.
Don’t let the description of Getmail put you off. I don’t think the maintainers have changed it in years. In that time, IMAP4 and, presumably, other features have been added to it.
Browsers
This one is easy. Some rather annoying websites seem to go out of their way to only work perfectly with Internet Explorer, but even dedicated Microsoft users sometimes prefer Firefox or Chrome. Mozilla Firefox (www.mozilla.org/ projects/firefox/) is an open source Web browser, designed for standards compliance, performance and portability. I have run Firefox for a long time, so I usually run at least one Firefox at work--in my CentOS environment. That means it’s getting a bit long in the tooth, but it’s more than adequate for the bulk
of my browsing. Install it with yum -y install firefox.
For lightweight browsing, I use Dillo (www.dillo. org/), which is a very small and fast Web browser using GTK. Dillo is very basic. It’s graphical, but has no frames, HTTPS, or JavaScript support. I’ve used Dillo for a while now, and am satisfied that it is not going to destabilise my system. However, it is not available in standard Yum repositories in CentOS, so it just seemed easier to install it in my Fedora VM. Install with yum -y install dillo. Total download size is 3.5 M.
For even more lightweight browsing, there are Lynx (lynx.isc.org/) and ELinks (elinks.or.cz/). Lynx is a textbased Web browser that does not display any images, but does support frames, tables and most other HTML tags. One advantage it has over graphical browsers is speed; Lynx starts and exits quickly, and displays pages swiftly. Install it with yum install lynx.
ELinks is another text-based Web browser that’s very similar to Lynx in all respects mentioned. Install it with yum install elinks.
These text-mode browsers can be very handy when you are interested in content rather than presentation. But why two browsers, you may ask? I have used Lynx for over 15 years. It’s reliable, solid and basic. However, its rendering of tables is unattractive and it lacks any sort of JavaScript support. Surprisingly, ELinks does have JavaScript support, so there are sites that can be viewed in Elinks but not in Lynx or Dillo.
I haven’t used ELinks for a long time. I have found it hard to get used to its user interface where it differs from Lynx (like having to hold down the Shift key while using the mouse, to select or paste text)—but I’m coming around.
Lately, I have found some irritants with Firefox, so I have started experimenting with Google Chrome (chrome.google. com). I run Google Chrome in my Fedora VM. There’s a nice how-to at http://bit.ly/M8BhFZ/. Install it with:
cd /tmp wget https://dl-ssl.google.com/linux/linux_signing_key.pub rpm --import linux_signing_key.pub echo “[google] name=Google Chrome 32-bit \ baseurl=dl.google.com/linux/chrome/rpm/stable/i386” >> /etc/yum. repos.d/google.repo yum install google-chrome-stable
I had been vaguely considering Google Chrome for some time, but my intention turned to action when I found that one application (Remedy) was causing Firefox to abort several times a day. I found this behaviour particularly galling because I typically have four or five Firefox windows running, each with up to ten tabs open. Every time Firefox crashed, there was a period during which my machine was unusable till all my sessions were restored. I now run Remedy in Google Chrome, and have not had a problem. It’s too early for me to ditch Firefox altogether, but the two browsers are sufficiently similar so it’s not onerous for me to run both.
Instant messaging
Microsoft Lync is an instant messaging client used with Microsoft Lync Server. In its place, I run Pidgin (pidgin. im) under Fedora. It is also available in CentOS, but not pidgin-sipe, which is needed to talk to Lync. Pidgin allows you to talk to anyone using a variety of messaging protocols including AIM, MSN, Yahoo!, Jabber, Bonjour, Gadu-Gadu, ICQ, IRC, Novell Groupwise, QQ, Lotus Sametime, SILC, Simple and Zephyr. These protocols are implemented using a modular, easy-to-use design. To use a protocol, just add an account using the account editor. Pidgin supports many common features of other clients, as well as many unique features, such as Perl scripting, TCL scripting and C plug-ins. Pidgin is not affiliated with or endorsed by America Online, Microsoft Corporation, Yahoo! Inc, or ICQ Inc. Install it with yum install pidgin pidgin-sipe.
Software for conversion
In the previous sections, my focus was inter-operation. To my mind, this section is at least as important. In the Microsoft world, your co-workers tend to reach for Word almost by reflex. Quite often, I am sent Word documents that contain a few lines of text, something that I think would be more appropriate if created in Notepad or WordPad, or better yet, simply entered directly in an email. If they don’t send me attachments, then their emails are sent as HTML. Most of the time, it is overkill.
When it comes to lists, or any sort of tabular data, the choice is often Excel. There may be no intention to perform any sort of calculations--and yet, strangely, Excel seems to be the application of choice. For most of the operations I want to perform on this data, both Word and Excel documents are completely inappropriate. In the past, I tried to ask for documents in a more useful format, but often my requests were met with blank looks. I have since gathered a number of tools to allow me to convert such data to something more satisfactory.
Word documents
For a long time, my tool of choice was Antiword (www. winfield.demon.nl/). Antiword is a free MS-Word reader. It converts the documents from Word 2, 6, 7, 97, 2000, 2002, and 2003, to text, Postscript, and XML/DocBook. Antiword tries to keep the layout of the document intact. Install it with yum -y install antiword. Total download size is 175 k.
I use Antiword from NMH to ‘render’ MS Word attachments. My resume (CV) is in Word format (.doc). I found that all placement agencies accepted this format and some accepted nothing else. It was originally created for me in MS Word. Since then, I have used OpenOffice to make
modifications. Whenever I complete a set of changes, I always use Antiword to produce a plain .txt file. I then copy the .doc and the .txt, appending a sequential number to the name, in order to have a backup. So, for example, cv.txt.13 was produced from cv.doc.13 using Antiword. If I want to see what I changed between, say, cv.doc.13 and cv.doc.16, I use the following command:
diff cv.txt.13 cv.txt.16
It’s quick, lightweight and easy to read. The format of my resume may not be perfect, but the words are correct. Most agencies simply toss the document into some sort of database, so that they can search for certain capabilities. I’m sure the database is not the least bit interested in the format in which the document displays. Resumes are usually emailed, not printed. It’s not that the format is so dreadful; it’s just that things like tables may cross pages. But it’s always going to be difficult to guarantee that sort of layout. A different printer can cause the layout to change. If I want it to be perfect, I create a PDF.
There is one issue with Antiword: it does not handle .docx. In the past, this was not a problem, but as more users migrate to more recent products from Microsoft, .docx is becoming more common. I have seen nothing to indicate that the author of Antiword is planning modifications to handle .docx. And that’s not altogether surprising. The difference between .doc and .docx is not just a few extra features; it’s a completely different format. A .docx file is a zip file containing several other files, many of them .xml. If you are interested in converting .docx, you might investigate docx2txt at docx2txt.sourceforge.net.
An alternative to Antiword is catdoc from www.wagner. pp.ru/~vitus/software/catdoc/ but I can’t offer an opinion, because I haven’t tried it.
The reason I have not looked at docx2txt or catdoc is because I now use LibreOffice (Writer—as detailed earlier) for this sort of conversion. And, yes, LibreOffice handles .doc and .docx seamlessly. Here’s an example of how to run it from the command line (or a script):
libreoffice --headless --convert-to txt:Text AttributeReview.docx convert /tmp/AttributeXReview.docx -> /tmp/AttributeXReview.txt using Text
It’s just some extra typing compared to Antiword, but you could avoid that with an alias.
Spreadsheets
For a while, I used xls2csv (which comes from the same stable as catdoc). It worked fine until it came to dates. There are several date formats used internally by Microsoft Excel, and xls2csv was getting them wrong in the documents I was trying to convert. In a state of confusion, I stumbled on a different program called xls2csv at search.cpan.org/~ken/xls2csv-1.07/ script/xls2csv. I haven’t tried this one because of what I read at vinayhacks.blogspot.com.au/2010/04/converting-xls-tocsv-on-linux.html. What I use instead is LibreOffice (Calc, as detailed above). It has no problems with dates; and it also handles xlsx. Here’s an example of how to run it from the command line (or a script):
libreoffice --headless --convert-to csv Access.xls convert /tmp/Access.xls -> /tmp/Access.csv using Text - txt - csv (StarCalc)
Possibly the main drawback with LibreOffice is that it has a heavy footprint compared to the other applications I have mentioned. But, these days, if your alternative is to run XP or a later offering from Microsoft, you need a machine that can carry the load. Further, if you plan to follow my general approach and run some of these tools in a VM, you are going to need a fairly beefy machine. My experience has been that performance is brilliant. At work, I have an Intel i7 (which I didn’t pay for). That’s the whole point: this is about Linux at work—software for the office.
Oracle databases
For interactive work, SQLDeveloper provides an environment that’s consistent across Microsoft and Linux platforms. It has a helpful GUI that makes it very easy to use. Once you’ve mastered the arcane syntax required to connect to the database, the SQL needed to extract data is not too hard. The GUI provides a lot of help.
To run, this tool requires IcedTea (icedtea.classpath. org), the OpenJDK development tools. Install these with yum install java-1.6.0-openjdk-devel. The URL for SQLDeveloper is http://bit.ly/99P9Zv. The total download size is 148 M. Next, install SQLDeveloper with yum --nogpgcheck localinstall sqldeveloper-3.0.04.34-1.noarch.rpm.
However, for unattended operation, I choose SQLPlus. Although there are a number of irritating things about it, I can ignore them all once I have extracted the data I need out of an Oracle database into a CSV. The URL is www.oracle. com/technetwork/topics/linuxsoft-082809.html for Instant Client Downloads for Linux x86. You can download oracleinstantclient11.2-basic-11.2.0.3.0-1.i386.rpm and oracleinstantclient11.2-sqlplus-11.2.0.3.0-1.i386.rpm. Install these with yum --nogpgcheck localinstall oracle-instantclient11.2basic-11.2.0.3.0-1.i386.rpm (total size: 168 M) and yum --nogpgcheck localinstall oracle-instantclient11.2sqlplus-11.2.0.3.0-1.i386 (total size: 2.6 M).
Putting it all together
I’m going to outline the sort of tasks that I use these tools for. Typically, people maintain or generate some data, and then
want that data used to generate some other data or a report. So I am told to use an Excel spreadsheet on a network share as part of a process. Typically, I write a shell script. Part of the process might involve using LibreOffice as mentioned above to convert the Excel spreadsheet to a CSV. Perhaps I extract some of the fields from the CSV, use them to interrogate a database, match the output against some other criteria, and finally generate a new CSV.
I can send the output CSV to my customer because Excel accepts CSV as input. I suppose if it were requested, I could use LibreOffice to convert the .csv to .xls or .xlsx, but I have never been asked for that.
I find that scripting is much more powerful than many of the things one might try to do in Excel. The process can be made more automatic, which is particularly advantageous if the process has to be run frequently or regularly. In the latter case, I can invoke my script from cron.
But do bear in mind that I am talking about tools. It’s always best to find the most appropriate tool for the task. I haven’t covered everything, but with this arsenal I can go a long way.
My previous article (Funny Mythness) discussed ways in which you could have Linux in the workplace using
(Continued from Page 49....) Translatewiki.net
This is a clever project that is in the process of localising MediaWiki. The Translate MediaWiki extension was started in 2006 by translatewiki.net/wiki/User:Nike and translatewiki.net/ wiki/User:Gangleri, and has become very popular for localising MediaWiki, its extensions and a host of other software. MediaWiki itself has been designed with internationalisation and localisation in mind. So it’s no wonder that it is available in over 280 languages. Like other Web-based projects, this too requires a contributor to create an account and select preferred languages. Then a project can be selected for localisation, and its various messages can be localised.
Figures 3 and 4 show a typical localisation screenshot. The suggestions from translation memory are shown, along with the percentage of matches, and the blue dots following the number are hyperlinks to the actual translation. The information about the context of the string is shown next, followed by the source, and then an edit box to enter the localised text. This update is saved just like a Wikipedia page. Additional menu buttons allow easy navigation across the messages. Another advantage with this tool is that most updates will go live on the respective language wiki projects of Wikimedia Foundation in 24 hours.
Most Indian-language MediaWiki projects would have been already localised. But occasionally, users may come across pages for which some messages are still in English (Figure 5). Usually, when a project is partially localised, trying to search for the specific message is time-consuming virtual machines. In this article, I’ve suggested ways in which you can move more towards Linux. I’ve talked about applications that allow you to inter-operate with others who are probably restricted to Microsoft’s office applications; and I’ve discussed tools that allow you to convert from inconvenient formats to those more amenable to manipulation using Linux tools.
In the next article, I will look at UNIX tools and how to unleash their power on files converted with the tools in this article.
By: Henry Grebler
The author has spent his days working with computers, mostly for computer manufacturers or software developers. His early computer experiences include relics such as punch cards, paper tape and mag tape. His darkest secret is that he has been paid to do the sorts of things he would have paid money to be allowed to do. Just don’t tell any of his employers.
He has used Linux as his personal home desktop since the family got its first PC in 1996. Back then, when the family shared the one PC, it was a dual-boot Windows/Slackware set-up. Now that each member has his/her own computer, Henry somehow survives in a purely Linux world.
He lives in a suburb of Melbourne, Australia.
for typical free software. In MediaWiki, it becomes very simple to locate the message_id by appending ‘?uselang=qqx’ to the URL of the page. In such a case, MediaWiki software displays message_ids rather than actual English strings (Figure 6). Then you can use the message_id to search Translatewiki.net to directly locate the untranslated message string and translate it (Figure 7).
In this article, we have seen three different Web-based platforms for localisation, which make it easy for anybody to contribute to localisation in their preferred languages. So why not try your hand at it, and share your experience with fellow readers? I will be happy to devote an article exclusively to your feedback and questions.
For more information
[1] Launchpad home page: https://translations.launchpad.net/ [2] Pootle features: translate.sourceforge.net/wiki/pootle/features [3] LibreOffice translations using Pootle instance: https:// translations.documentfoundation.org/ [4] Translatewiki.net home page: translatewiki.net/wiki/Main_Page
By: Arjuna Rao Chavala
The author is an independent consultant in the areas of IT, program/ engineering management and open source. He is also the president of Wikimedia India and the WG Chair for the IEEE-SA project P1908.1, ‘Virtual keyboard standard for Indic languages’. He can be reached through his website arjunaraoc.blogspot.in and Twitter ID @arjunaraoc.