Wednesday, September 07, 2011

Convert .doc to .pdf in command line using Libreoffice

The command would be 
 libreoffice --headless --convert-to pdf test.doc

test.doc is the document which we needed to be converted into pdf and this command will produce test.pdf in the same directory since we haven't specified a output directory.

Apparently this can be used to convert many more types of documents. For example converting a pdf file into odt would work too. 

libreoffice --headless --convert-to odt test.pdf

Its interesting to have a look at the command line options provided by the Libreoffice

LibreOffice 3.6

Usage: soffice [options] [documents...]

Options:
--minimized    keep startup bitmap minimized.
--invisible    no startup screen, no default document and no UI.
--norestore    suppress restart/restore after fatal errors.
--quickstart   starts the quickstart service
--nologo       don't show startup screen.
--nolockcheck  don't check for remote instances using the installation
--nodefault    don't start with an empty document
--headless     like invisible but no userinteraction at all.
--help/-h/-?   show this message and exit.
--version      display the version information.
--writer       create new text document.
--calc         create new spreadsheet document.
--draw         create new drawing.
--impress      create new presentation.
--base         create new database.
--math         create new formula.
--global       create new global document.
--web          create new HTML document.
-o            open documents regardless whether they are templates or not.
-n            always open documents as new files (use as template).

--display
      Specify X-Display to use in Unix/X11 versions.
-p
      print the specified documents on the default printer.
--pt
      print the specified documents on the specified printer.
--view
      open the specified documents in viewer-(readonly-)mode.
--show
      open the specified presentation and start it immediately
--accept=
      Specify an UNO connect-string to create an UNO acceptor through which
      other programs can connect to access the API
--unaccept=
      Close an acceptor that was created with -accept=
      Use -unnaccept=all to close all open acceptors
--infilter=
      Force an input filter type if possible
      Eg. -infilter="Calc Office Open XML"
--convert-to output_file_extension[:output_filter_name] [-outdir ouput_dir] files
      Batch convert files.
      If -outdir is not specified then current working dir is used as output_dir.
      Eg. -convert-to pdf *.doc
          -convert-to pdf:writer_pdf_Export -outdir /home/user *.doc
--print-to-file [-printer-name printer_name] [-outdir ouput_dir] files
      Batch print files to file.
      If -outdir is not specified then current working dir is used as output_dir.
      Eg. -print-to-file *.doc
          -print-to-file -printer-name nasty_lowres_printer -outdir /home/user *.doc

Remaining arguments will be treated as filenames or URLs of documents to open.

PS :-
As pointed out by Martin(read comments),  Looks like the above command will not work if the libreoffice application is already running. Thanks for point it out Martin. Does anybody know a work around?

Friday, October 16, 2009

Remove mono from Karmic Koala ( Ubuntu - 9.10 )

One of the very first things I did in my new system was to remove mono.

so what is to be done is

apt-get purge mono-runtime

Then install all the other cool apps which are not written in C#. Run the below command and see which apps depends on mono runtime.

apt-cache rdepends mono-runtime

Kal.

Karmic Koala is awesome

Recently I installed Karmic Koala 64bit beta version in my laptop(HP compaq 6720s) and it's really awesome. The graphic issues which I had in jaunty seems to be gone with the new system works fine with Intel 965 chipset. And there are some major changes like Grub2, upstart, Telepathy which needs some time to get familiarise with. Hope to write more on this new experiences and how to get work done. For a list of changes follow this link

BTW I had some issues with broadcom wireless card but it may be because this is beta version and with the help of a wired network it was quickly solved. We have 13 more days for the final releae and I really like to say THANK YOU for the all the people who put there valuable time to bring this awesome operating system to the community.

Thursday, July 09, 2009

Remove mono completely from Ubuntu 9.04

Follow this link and execute the command stated there there
http://www.stefanoforenza.com/remove-mono-from-ubuntu/

I should say a big thank you for the person who maintain the above site. I was concerned about the ongoing debate about having mono in Ubuntu by default and with this presentation(PDF) (and the video here) at Defcon 15, thought it's better to be removed from my system.

Anyways there won't be any problem by removing it. At least for me. What I'm going to miss is Tomboy and F-spot. From Karmic, I'm going to miss Banshee too. But comparing the alternatives it's better have the alternatives :)

Gnote is a great replacement for Tomboy and seems to use less amount of memory.
To install Gnote in Jaunty we have to use PPA. But in Karmic hopefully it will be in repos.

F-spot is a software that I didn't use actually. To copy images from a camera can be done using nautilus and can be opened and edit using gThumb Image viewer generally.
But there is some kinda replacement is comming up. Read here : Solang

Banshee vs Rhythmbox : I don't won't my system to run as a radio. And I do other work which require more memory and processing power than the music player.

As I heard we are going to miss Rhythmbox in Karmic but still the great Debian package manager is there to download it.

Monday, May 18, 2009

Unlocking Young Minds - 2009

Our colleagues been able to do it again successfully after 2 years. This time I actually been able to contribute to the exhibition by organizing the Operating system section and helping the Open Source section which was next to our section. I take this opportunity to say a BIG THANK YOU for Uthpala, Yoshan and 2 of the batch 7 brothers who did explanations to the curious attendees. Even though Me and Uthpala was supposed to work on OS and Open-source sections respectively, I got a chance of jumping in to FOSS section too. And I gladly remember my friend Uthpala and his great knowledge(Comparatively Superior to most of us) which helped me alot during the event. And so many thanks goes to the other friends(Nadeesha, Hayesha, Indika, Chinthaka, Prabath, Kawthisa, Chamile etc...ect...) who helped us in setting up the environment, spending their time and energy to make our section a success in this Exhibition. Karunaratne sir also tried his best to power up our section by providing extension codes from his room and it's no wonder since he's using Ubuntu in his Desktop. Thank you sir. I should respectfully remember the most dedicated pair, who worked to make this event a success Abekoon and Deneth. Without them it would be a nightmare for the faculty to do this event. And idea of having a section called OS and Open-Source software first put to the table by Deneth and Thanks alot for that too. Last but not least I should show my gratitude towards the people who came to our section asking various questions. Thanks everybody, you encouraged all of us.

So after this thanks giving, it is better to look back and talk about the experience we got, so it will help us to improve our self and others too. The fun part of involving in explaining stuff relating to OS and FOSS was multiplied by having a entire room for Microsoft stuff next to our room. The expectation of having a section called OS was to give a basic idea about Operating Systems and it functionalities. We been able to setup Minix, Solaris, FreeBSD, Fedora, Ubuntu and a Mac book as example of OS. Of course we deliberately drop Windows because it's already available in the preceding room. In FOSS section, the idea was to introduce Free Software and Open Source software which can be used in various platforms for various reasons and we tried to explain the differences between licenses also. For this section we setup three machines, including one XP box loaded with FOSS. Having these sections in one room is not a coincident. What we want was there are some other Operating Systems besides Windows and that is Linux.(Actually we promoted Linux very much rather than BSD or OpenSolaris. Ubuntu was the winning Distro). After these two sections, there were two other sections for examples of Open Source developments. Section for SAHANA project was conducted by Hayesha(one of the commiters of the project and one and only open source developer I personally know in our batch), and there was another project done using WSO2 WSF by two of our juniors.


There were many different people who came to our section after climbing 3 stories and finding our section in a dark corner after the Microsoft room. Before coming to our stall they have to resist the temptation of going to the Game stall, Microsoft stall and Turing back because they are too tired to watch any more. But there were many people who were willing to know stuff. I'm planning to write another post on what mistakes we made, what were most of the people were seeking for. And a comparison of Microsoft stall and our section activities.


Finally one of the great things to be heard after an event like this was heard by Yoshan during the technical session under the Topic of Information Security, which been held last evening of the exhibition.
The Presenter : (Asking from the audience..) You watched the exhibition right..? So which sections you did visit..
Audience : (Most of them had common answer) We went to the OS/FOSS section, we saw Linux, we saw Open Source.

What else you can expect better than this....

Monday, March 23, 2009

Display a fortune when u open terminal

Just put this entry in ur ~/.bashrc and u will be treated with nice fortunes whenever you open a new terminal
/usr/games/fortune -a

Samples :D
~~~~~~~~~~~

Naturally the common people don't want war... but after all it is the leaders
of a country who determine the policy, and it is always a simple matter to
drag the people along, whether it is a democracy, or a fascist dictatorship,
or a parliament, or a communist dictatorship. Voice or no voice, the people
can always be brought to the bidding of the leaders. That is easy. All you
have to do is tell them they are being attacked, and denounce the pacifists
for lack of patriotism and exposing the country to danger. It works the same
in every country.
-- Hermann Goering

------------------------------------------------
Zen poem

To follow the path:
look to the master,
follow the master,
walk with the master,
see through the master,
become the master.

------------------------------------------------

Tuesday, February 03, 2009

Building a HSM_RKM for PKI

This is my final year project and I would like to give an introduction to the project through this post. The project is about building a Hardware secured, Root Key Manager for a Public Key infrastructure which operates off line. Root Key Manager is the system which provides keys to the top node(Root CA) of the PKI. The security of these keys are vital to maintain the trust of whole PKI. Therefore we need to secure the RKM in various ways. Currently there are systems which provides the functionality to some extent. But the problem with the available systems are, they cost huge amount of money and they aren't open to public since they are properitery. The Goal of this project is to built a system which is low cost and open for academia for further extentions and studying purposes. The project is supervised by Dr. Chandana Gamage.

The initial system requirement
  • Access to the HSM-RKM must be controlled via a two-factor
    authentication mechanism
  • Should provide output of the HSM-RKM through a portable external
    interface such as a USB-Flash-ROM memory device
  • Generate the root key pair and securely store the private key
    within the HSM-RKM and output the public key through the external
    interface
  • Generate a limited number of other key pairs and securely store
    the private keys within the HSM-RKM and output the public keys
    through the external interface
  • Self-certify the root-key public key certificate
  • Certify any other public key certificate input through the
    external interface
  • The HSM-RKM must be of suitable dimension and construction to be
    securely stored in a safe
I'm going to use this post to comment on the progress and changes of the project work hereafter.

Friday, January 16, 2009

Working with FreeBSD

Yahoo...!
It's finally up and running :D
I change the operating system of our own tiny knowledge sharing server to FreeBSD 7 from Ubuntu. Now all the needed services are running and our guys can use it. This is going to be a good opportunity for me to experience how to administrate a Free-BSD server and should improve the security of it too.
There are ample of resources avail on Internet about configuring BSD. Thanks for the community for comming up with such resources and guidance. A good method of finding BSD specific stuff is using
www.google.com/bsd

Friday, November 28, 2008

Display-dhammapada

This is a app like fortune which will display a verse from Dhammapada. It seems to be really good and helps us time to time who we are and why we are here(if u use it excessively)

Big Thank you to the developer of this nice app.

The author is Ričardas Čepa.

You can find it here.
http://unicode.strangled.net/me/rch/dd.html
http://freshmeat.net/projects/display-dhammapada/

You can install it for ubuntu using
#apt-get install display-dhammapada

This is xdhamma


This is display-dhammapada

Saturday, November 01, 2008

Ubuntu

I never thought its going to be Ubuntu that I'm going to use with my laptop. nut it happened.after bringing it up to the level
i need, the new release came. 8.10. Most of my friends suggest not to install it and guess there will be lot of bugs that will eventually bring down the whole machine. Ok, but somebody have to do it. :)
After all it will be just installing the OS again, if something goes wrong. Its still downloading the new packages and hopefully
it will work fine. :D
The best thing was two of my friends install Ubuntu in there machines(one was a PC and the other was HP pavilion). Everything is ok with PC but it didn't recognize Vista during the installation. :)
With laptop we didn't have needed firmware to bring up the wireless card. :(
but we been able to compile the new kernel with drivers and viola.. It works.But my friend need to get all these compiz effects with his nvidia card and it didn't work. We refer half of the web but for no result.
Ubuntu is good. its good as the starting point. I can talk about the starting point since I'm in the starting point.
There are nearly 10 or so people who use linux(ubuntu mostly) for there day to day work. Kind of a leap in progression as a result of moving to the level 4 :)
Hope there will be more friends to share the knowledge with the end of the Semester.

Friday, May 30, 2008

PCLOS

After trying 6 distros including
ubuntu - shld have a internet connection
mepis - great, But KDE
fedora 8 - good but I feel it's not for me(Too much)
BLAG - good distro based on FC7, but seems it need internet connection too
OpenSuse - big mistake, it crashes when I tried to mount NTFS (after all it comes from Novell)
then I came to know PCLOS
actually this one seems to good for my needs since it has almost everything and can be download what ever the software we want with dependencies.
just try apt-get install wireshark
it will show what it needed and where we can download it. Since I don't have internet connection it can't connect and it will show the error with link.
So I can use the links to download the rpm's.
Maybe this can be done with apt-get with every distro, and that shld find out first. If it is yes I can go to my ever loving ubuntu.

Tuesday, March 18, 2008

Shell Scripting Workshop

Last weekend that is on 15th March 2008 I got a chance to participate to a shell scripting workshop done by LUG members. One of my good friend Hayesha gave me this chance . I don't think I have enough words to describe abt the knowledge gained by that event and the inspiration got from the geeks who were there.
Some of the known names were Anuradha Ratnaweera , Bud, Suchetha Wijenayake, Sanjeewa Wijerathne , D. Anuradha and Sapumal.

Bud and Anuradha have put some pics taken on that day. We can see those things here, here and here also

Wanna say a big thank you for the guys who involved in this process and made it a success.

Tuesday, March 04, 2008

Silverlight

Hey
Today I visit Microsoft site to see what they are upto ;-)
And in home page they have an add abt there new server 2008 :-)
the funny thing is they ask to install silverlight plugin to view more graphics and functions and when we click it we will direct into another page to download silverlight(not bad..better to ask twice b4 install microsoft things :-)
the funniest part is they gave me an exe, where im using GNU/Linux and access the site using firefox. (Who the hell they think they r, do they think we will use windblows to see what silverlight can do,....? )

Anyways this statement always true.

microsoft have g8 ideas...

Saturday, March 01, 2008

Linux

Ok.. Up to now I have tried Mandriva then Ubuntu and then Mepis and then Fedora. Actually I spend lot of time in front of Fedora box because of the training period,
Recently I tried to install Solaris 10 but as the owner of the DVD said its better to install in a separate HD than trying to dual boot it. Seems to be true as I tried to install it to the existing one the process seems to be bit complicated. SO I'm waiting for a second hand HD. (Nxt week I'll get a 80GB for rs 2000, 2 & half years old ,, (is ot too much..))

I gave the Mepis Distro to two of my friends But none was satisfied with it. The driver problems force them to use something else than Mwepis. And most of them prefer GNOME too. Yeah maybe KDE is too much and it remembers MS windows blah.. blahh .. blah..
But i shld admit although KDE has more cool apps still GNOME seems to be powerful and its not that memory hungry.. So the best one for me if we gotta internet connection is Ubuntu, and if u don't have ti shld be MEPIS as it contains all the codecs and cool apps needed for a Desktop box.

I'm still in the crusade to find out the most suited version for me. But as most of the people say we shld use the most suitable thing to get our work done asap.