Open Source Software and Linux

September 4, 2008  11:54 AM

Script Word and OpenOffice documents to pdf

John Little Profile: Xjlittle

I ran into a situation a couple of weeks ago where it would be convenient to script Word and OpenOffice documents into pdf format. One of my jobs here is to create the network and email login documentation for newly hired people. I have the document creation automated through an AutoIT script. I previously posted about AutoIT here.

The next step after creating the Word document is to copy it to my Linux workstation where my Lotus Notes client resides. Once there I want to convert it to pdf and attach it to an email for sending to the new hire’s manager.

I copy the newly created Word document using Putty’s pscp application. This script is called from the AutoIT script that creates the documents. The pscp script is written as follows:

pscp -pw mypassword -r c:\userdocs jslittl@centos5-xvm:/home/jslittl/Documents/Notes-Domino/users2convert

You can place this script at the end of your AutoIT script so that it copies your document to wherever you want. So this is where I am in the process: AutoIT script to create the document => scp the document to my Linux workstation.

I followed the instructions here to setup OpenOffice for scripting the documents to pdf. My script to do so is setup like this:

[jslittl@centos5-xvm userdocs]$ cat
for i in *.doc; do echo $i; doc2pdf "$i"; sleep 5; done #this will convert all documents in the directory
# zip newusers *.pdf # this is for when there are a large number documents going to the same place-easier to attach 1 zip file
mv *.doc `pwd`/finished-doc # I created the next 3 directories to hold the finished documents
mv *.pdf `pwd`/finished-pdf
mv *.zip `pwd`/finished
[jslittl@centos5-xvm userdocs]$

That’s it! Just attach them to the email and send them on.

September 1, 2008  9:34 PM

Ubuntuserver is unbelievably stupid

John Little Profile: Xjlittle

Yes you read the title right. Ubunutserver is unbelievably stupid.

Ok let’s take it from the top. I had Ubuntuserver 7.0.4 installed as my WebDAV secure server, my son’s baseball team’s website, samba and so on. I run this server headless and without a gui. Note here that the normal install is without a gui and is touted loudly by the folks who develop ubuntuserver. This is all well and good.

Lately it’s been on my mind to look into and install a collaboration suite. Having searched around I finally landed on Zimbra.

After reading the documentation I see that Zimbra is certified on Ubuntu 8.04 LTS. Ok, well this is as good of a time to upgrade as any. This is where the fun (read stupidity) begins.

I ssh into my server as normal. I do all of the pre-distribution upgrade stuff, reboot and begin the distribution upgrade. The first thing I get is a message saying something to the effect of “We do not recommend using SSH while you upgrade. If you lose a connection it is difficult to recover.” Ok. I’m not doing this over a WAN link but on my local LAN. I haven’t had any network outages since I don’t know when, the sun is shining so no power outages looming. Things are looking good.

The upgrade proceeds smoothly. On several occasions I am asked if I want to replace any of my configuration files. This include the sshd configuration file. On all of these I take the default which is “Do not replace, I want to keep the configuration file that I am currently using” . That’s paraphrased but that is what it meant.

The distribution upgrade finishes. I get a nice message saying everything went well and asking me if I want to reboot. Of course I do. I type y and off we go. After waiting the appropriate amount of time I try to SSH back in. I am pretty excited at this point about getting my Zimbra install started.

Uhoh. No such luck. The dreaded “ssh: connect to host port 22: Connection refused” message. What?!? Are you kidding me? No way. I try pinging the server. Yep, network came back ok. I try again. Nope. And several times after that. Now I’m writing this rant.

You see, here is why I think this is stupid. The server installs without a gui. That implies that no one is going to use this for a workstation. If no one is going to use it for a workstation, why then, should it have a monitor on it? If it doesn’t have a monitor on it, why would you not want someone to upgrade using SSH? Would the Ubuntuserver people prefer telnet instead? If the upgrade process is smart enough to know that you are upgrading over SSH then why not start SSHD on the reboot? If that is in fact the problem since I haven’t dragged a monitor over there to see.

I made a decision not long ago not to scrap my Ubuntuserver in favor of CentOS. I am starting to regret that decision. You see there is at least one other annoyance with Ubuntusever that I don’t find appealing either. This is the fact that they have decided that using an inittab is old fashioned or something. While this doesn’t have much affect on a server, at least one not running a gui, have you tried to boot into runlevel 3 lately? It’s not nearly as easy as it is with a GRUB boot loader where you can edit it, type in 3, hit enter and b and boot to runlevel 3.

Ok, I’m done. Next free time that I have I’m putting CentOS on there (as soon as I drag a monitor to the server and get SSHD started that is).


August 31, 2008  11:37 PM

To gmail or yahoo..

John Little Profile: Xjlittle

Do you like gmail? I don’t. I first started using gmail a few months ago when it looked like Microsoft had a good chance of purchasing Yahoo. I’ve had a Yahoo account for over ten years. I’ve since gone back to Yahoo.

No, not because Microsoft didn’t buy them. I just don’t like gmail. You can’t create folders in which to store your mail. Instead you have to label it. Then, to *start* finding it you have to click on the All mail link. Then you have to find one of the mails labeled with the subject. After that you do a More actions and click of filter more messages like these. What a mess. What a waste of time.

You can’t highlight mail that you want to delete by holding down the control key. Oh no, that would be too easy. You see, gmail has single click like a web link. I despise that in Windows and the Linux KDE desktop and I don’t like it here either. At least in Windows and on the KDE desktop you have the option to turn it off. So with gmail you have to click select all and then go through and deselect the mail that you don’t want to delete.

Yes I still have mail going into my gmail account. I did change some of it for my RHEL and Sun accounts. Maybe a few others. But, at the end of the day, I still prefer Yahoo mail over gmail.

And yes, the new Yahoo has it’s share of problems as well. I don’t know what is with the Yahoo developers that they can’t seem to develop something that at least either works on Firefox or Opera. Or maybe it’s the Firefox and Opera developers. The chicken and egg thing. But that’s a rant for another day.


August 30, 2008  11:16 PM

Single signon with Clipperz

John Little Profile: Xjlittle

Clipperz provides single signon capabilities using a web browser for all of your web based sites. Clipperz is an open source project started in 2005 by Marco and Giulio Cesare. I have been using Clipperz now for about six months on a daily basis.

From an end user perspective the process is quite simple. Go to Clipperz and register. After registering you can then start adding the sites that you visit that require a password.


Once you are on the logged into Clipperz click on the Tools link on the orange tool bar on the right hand side. Once on that page scroll down and drag and drop the Add to Clipperz widget to you book marks bar.


Now browse to a web site that requires that you login. While at the login page click on the Add to Clipperz link in the bookmarks toolbar. A small pop-up window will open with some code inside. Copy this code and click on the tab (you are using tabbed browsing aren’t you?) where you are logged into Clipperz. Scroll down to the bottom of the page and click the radio button next to Direct login. Now paste the copied code from the pop-up window into the box title Direct login configuration and then click the create button.


After clicking the create button a new text box will show. This is where you put in your login and password information for the web site that you are adding to Clipperz. After you put this in and create it the web site will show on the middle and left hand side of your screen.

Click on the web site link listed on the left hand side of your screen. This will open up a new tab and automatically log you into the site. If you want to edit the title or change the pasword (or if you got it wrong when creating the link) click on the link in the middle of the page. This will allow you to edit your login information. It even has a facility to decrypt your password if you want to see what it is or just make sure that your are typing it correctly.

For the more technical or paranoid among us Clipperz uses Ajax and JavaScript technologies built into your browser to encrypt your passwords. The encryption takes place locally on your computer before being sent to the Clipperz servers. Thus the only thing sent over the internet or stored on their servers are the scrambled bits of your password.

With the advent of SaaS and Cloud Computing you need a secure single signon solution for your web based sites where you store photos, financial data and other electronic data. Clippez fills this need as well as working as a password manager and a vault for confidential data. Give it a spin today!

Full disclosure: I have no affiliation with Clipperz other than being a satisfied user.


August 29, 2008  3:35 PM

Script repetitious tasks in a GUI with AutoIT

John Little Profile: Xjlittle

Do you find yourself wanting to script repetitious tasks in a GUI? Wish there was a way to automate it? There is now.

Unlike shell scripting where many tasks can be automated this is generally more difficult in a GUI. You have mouse clicks and keyboard entries to make in a GUI. AutoIT is the answer to your problem. AutoIT is designed to script repetitious tasks in a GUI, specifically the Windows GUI and Windows applications.

AutoIT is freeware – not open source – designed to automate the Windows GUI and perform other general scripting tasks. I use it at work for setting up users in Active Directory and Lotus Notes. The Active Directory part I send to the Windows command line. The Notes part is done inside the Notes client. I even have it send the New User documentation over to my Linux workstation via SCP. There I have a Bash script convert the documents to PDF to be sent to HR. Pretty cool. It saves me hours of work every Friday. Which is why I can write this post and tell you about it 🙂

The AutoIT download comes with a lite version of the SciTe IDE. You can download a full blown version customized to work with AutoIT here. With the IDE you get syntax highlighting, script tidying, debug, the ability to compile the script to an .exe file and more. AutoIT even integrates into the right click text menu so that right clicking on the script gives you the ability to run, compile or edit the script. autoit-editor

If you need to send your scripts out to users, for instance to have them perform some task or installation on their machine, the compile function is a real life saver. We use it to compile the script that installs and sets up the VPN and then send it to remote users. Just burn it to a CD along with the necessary files so that it will autorun and Voila! more trying to do it over the phone. Or you could just send all of the files zipped up in an email and have them put it in a folder for running..but that does require relying on the user to do something.

AutoIT also provides AU3Info. AU3Info is a tool that will help you find window titles, mouse coordinates and much more window information that will help in writing your script. You need the active window titles and mouse coordinates so that AutoIT knows when a certain window is active. Once the window is active you tell the script where to place the mouse, left or right click if necessary and what keystrokes to send.

AutoIT comes with a full complement of everything required to write any sort of script whether you need to manipulate a GUI or something that you need to run from the command line. These include datatypes, functions, macros and many others.

The documentation is excellent and very easy to understand. The forums are active and friendly to new users. So if you’re tired of doing that repetitious Windows task why not give AutoIT a spin! It’s a great tool for any administrator.

Full disclosure: I am in no way associated with AutoIT other than being a satisfied user.

August 28, 2008  4:34 PM

Securely connecting Linux and Windows for file transfer and editing

John Little Profile: Xjlittle

The first question most Windows users want to know is how to retrieve, move or put files from their Windows machine to a Linux box or, conversely, how to retrieve them. The first thing most people think about is Windows file sharing. This, of course, requires setting up a Samba server just as FTP requires an FTP Server. So what is the quick and easy way for Windows users to get and put files from/to and Linux machine? Enter WinSCP.

WinSCP is an open source application built by Martin Prikryl. It let’s you securely connect to other machines using the SSH or SFTP protocols.

WinSCP is the answer to every Windows lovers dream. It’s graphical and very easy to use. If you have the ability to drag files from one window to another you can securely drag and drop files to a Linux machine and back to your Windows machine. All that is required is a username and password on the Linux box. Since the SSH daemon is setup by default on most Linux distributions it is not necessary to install any software other than WinSCP on your Windows machine.

WinSCP offers two graphical interfaces. I prefer the Norton Commander interface as it shows both the remote and local directories. I can also use my keyboard or mouse to move and copy files. The Windows Explorer interface shows just the remote folder. This interface is designed primarily for using your mouse. You can choose which interface that you prefer during installation. If you decide later that you prefer the other interface you can easily change it in the preferences dialog.

When you first open WinSCP you are presented with a login dialog. This is where you enter your username and password for your Linux box. You are given the opportunity to save the logon profile with or without the password. I recommend not saving the password.

On connecting it will open My Documents on your Windows machine and your home directory on the Linux machine.WinSCP Norton Commander Interface Here you can easily change directories on the local or remote machine for placing and retrieving documents or folders where you want them.

WinSCP is a very powerful application with many features. Some these include a command line interface that is scriptable. This can be automated through the use of the commands in a script file. WinSCP can also execute remote commands using a separate shell session much the same way you would use SSH to execute remote commands. You can also have several sessions open simultaneously if you need to connect to different servers.

This is a very basic overview of WinSCP. If you are looking for a way to connect yourself or your users quickly to a Linux box this is the way to go. For more information or to get and install WinSCP please visit their website at WinSCP.

Full disclosure: I have no ties at all with WinSCP other than being a very satisfied user.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: