Monday, April 02, 2012

Hiren's boot cd using unetbootin (missing boot options)



If you try to use unetbootin to copy Hiren's bootcd on a usb flash drive and you boot using the flash disk, you'll notice that some options are missing, especially the "mini windows xp" boot option.

To overcome this problem you have to copy the file "HBCD/isolinux.cfg" to the main folder and replace the file "syslinux.cfg"

Then everything will work as expected.

Bug report: https://bugs.launchpad.net/unetbootin/+bug/971403

Monday, March 05, 2012

Now you can read xps files in ubuntu!

About
  OpenXPS or XPS stands for XML Paper Specification. It is based on XML and it's a new electronic paper format originally developed by Microsoft and it serves as a PDF alternative. XPS files are usually created using "Microsoft XPS Document Writer" in Windows environments. It is now standardized as an open standard document format.

Quoting Wikipedia:
 An XPS file is in fact a Unicoded ZIP archive using the Open Packaging Conventions, containing the files which make up the document. These include an XML markup file for each page, text, embedded fonts, raster images, 2D vector graphics, as well as the digital rights management information. The contents of an XPS file can be examined simply by opening it in an application which supports ZIP files.

 The OpenXPS document format specification supports features such as color gradients, transparencies, CMYK color spaces, printer calibration, multiple-ink systems and print schemas.

 Evince already supports xps, but it has to be compiled with that option enabled. In order for evince (the program that allows you to read pdf document files) to read xps files, libgxps is required first.

Status update
..for libgxps in Debian (we'll see about Ubuntu afterwards):



There's a PPA!
After much frustration, I have created a PPA for evince with xps: https://launchpad.net/~medigeek/+archive/evince-xps/

Note: The evince version in Ubuntu 11.10 oneiric ocelot doesn't work with xps (segmentation fault when opening the file) and there are several packages to be backported. I've decided not to backport it. It works in Ubuntu 12.04 precise pangolin.
If you need to read an xps file, package libgxps-utils provides enough conversion tools, e.g. command:
xpstopdf myfile.xps

Friday, March 02, 2012

Libreoffice recent documents - History manager extension

This solution works for Windows operating systems as well as Linux distributions (It's actually system independent)
If you need to clear or define how many items the recent documents list bears, you can install this easy-to-use extension/addon/plugin: History manager for Libreoffice/Openoffice

- Click "Get it" and download the .oxt file.
- Open Libreoffice writer, menu > Tools > Extension manager > press Add and open the .oxt file you've downloaded.
- Close Libreoffice and re-open it. Go to menu Tools > Add-ons > History manager

Tuesday, February 28, 2012

How to set default apps (aka how to use xdg-mime)

How to set default apps in Chromium / Chrome / Firefox / Ubuntu Linux

Situation: You hate the default app that opens when you double click a file or when you open it with chromium browser and you want to change it.

a) In Unity (and probably Gnome 3 Shell), some default apps can be changed through gnome-control-center: System settings > System info > Default applications



b) You can also right-click on a file > select Properties > Open with. See what applications/programs are listed there. You can also add them and set them as default.


c) If none of the above work, you can use xdg-utils (xdg-mime) to set a default application for a specific Mime Type

First, you have to figure out what text string to use as a "mime type". An easy way to find it is to look into the default application's desktop file.

Example: Chromium opens magnet links and bittorrent files with transmission-gtk by default. The .desktop files are usually in folder /usr/share/applications/. We use "cat" command to look into the file /usr/share/applications/transmission-gtk (a line that starts with "MimeType"):

$ cat /usr/share/applications/transmission-gtk.desktop
[Desktop Entry]
Name=Transmission
[...]
Exec=transmission-gtk %U
Icon=transmission
Terminal=false
TryExec=transmission-gtk
Type=Application
MimeType=application/x-bittorrent;x-scheme-handler/magnet;
Categories=Network;FileTransfer;P2P;GTK;

Bingo! x-scheme-handler/magnet and application/x-bittorrent are the mime types we're after.

How to use xdg-mime command? Simple: xdg-mime default myapp.desktop mymimetype

..where we substitute myapp.desktop and mymimetype with the values from above.

Following the example above, we want magnet links and bittorrent files to open with Deluge (deluge-gtk) application. First you have to install the deluge-gtk package (otherwise the .desktop file won't exist). Then you have to execute:

xdg-mime default deluge.desktop x-scheme-handler/magnet
xdg-mime default deluge.desktop application/x-bittorrent
grep -i deluge ~/.local/share/applications/*

The last command (grep) should return "application/x-bittorrent=deluge.desktop" and the other mime type for magnet. Otherwise, something went wrong (maybe the desktop file didn't exist?).

And that's about it! Close and open chromium-browser again (or logout/login).

For the sake of documentation, the files that have to do with mime types and default apps are:

~/.local/share/applications/defaults.list
~/.local/share/applications/mimeapps.list
~/.local/share/applications/mimeinfo.cache
/usr/share/applications/mimeinfo.cache
/usr/share/applications/mimeapps.list
/usr/share/applications/defaults.list

Error creating XPS file


Error creating XPS file: Source _rels/.rels not found in archive
If you see the above error when trying to use xpstopng, xpstopdf, xpsto* tools provided by libgxps, then you probably suffer from this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=670895

In short, the problem lies with libarchive versions prior to 3.x and zip files created by windows.
Solution?
a) Just update to 3.x or newer and you'll be good to go.
b) As a workaround, you can recreate the zip file:

unzip lorem-ipsum-and-image.xps -d temp/
cd temp/
zip ../newfile.xps *
cd ..


You now have a working copy of your XPS document.