Posts about open source (old posts, page 1)

2009-10-20 21:31

Simple KDE Trick #2: using remote desktops with avahi, krfb and krdc

Most people nowadays have more than one computer. Often, you are using one, and would like to do something in another. In this video, I will explain how trivial it is to do that without leaving your seat in a modern Linux using KDE.

We will use the following:

  • Avahi, a zeroconf implementation to let you find your computers in your network without worrying about IP addresses, DNS, etc.
  • krfb, the KDE Remote Frame Buffer. This is a program to share your desktop over the network.
  • krdc, the KDE Remote Desktop Client, a VNC, RDP client, which is what you use to see a desktop shared via krfb.

I am sure users of other operating systems or desktop environments will say they can do it just as easily. In that case, feel free to do your own videos ;-)

Keep in mind that accessing remote desktops over the internet is a whole different beast, and this solution is not meant for that case.

As usual, this video was recorded using qt-recordmydesktop. There was minor editing using mencoder.

The computer used is the original Asus eee PC 701 4G, so you can see this is not exactly a hardware-intensive operation. I find the eee's small screen is great for this kind of full-screen demo, because it's not big enough to drown the important parts.

2009-09-22 13:33

More fun with rst2pdf, poppler and PyQt

First: I really, really need a name for this thing. I am tired of saying "my rst2pdf previewer/editor app".

Now, here's a video of how it looks nowadays after all the yak shaving (sorry about my english, I write lots of it, but never speak it):

As you can see, the basic app is fairly complete, even if it lacks all the amenities that would make someone use it (like, search? save? ;-).

It has one big problem, though: I can't publish it yet.

Why? Because I need to use poppler from PyQt, and the code I found to do it has no license (see the code).

I am trying to contact the author (Rajeev J Sebastian), so there should be news soon!

As soon as that's cleared, the PDF widget is a whole post by itself, because it's pretty neat, if I may say so myself.

UPDATE: the binding is now under MIT license, thanks to Rajeev Sebastian!

2009-07-02 11:25

Yay! sphinx-rst2pdf-builder works!

Ok, it kinda works a little.

I got commit rights in the mercurial repo, so now you can get the very very alpha version here.

This triggered several bugs in rst2pdf, so you need SVN rst2pdf for it to work.

What works:

  • Glossary
  • Plain restructured text ... with some caveats (example: footnotes are semi-broken)
  • Index generation (not 100%, but maybe 75%)

I don't know what other pieces of sphinx require specific rst2pdf support, but I will be hitting them as they come.

2009-07-01 17:58

rst2pdf: almost sphinx-ready

Some guys at PyAr are translating the python tutorial to spanish.

That tutorial, like all the new python docs, uses sphinx.

Since sphinx is very popular, I want rst2pdf to work as well as possible as Sphinx's PDF producer. So, two different things itching, I started scratching.

Well, progress has been made. While the sphinx changes currently reside only on my computer, I will publish them soon, and the rst2pdf changes are already committed.

Here's a sample to whet your appetite.

2009-06-23 09:16

Responding to random blog posts. Today: 2009: software installation in GNU/Linux is still broken -- and a path to fixing it

While randomly clicking today I saw this article with the fun title of "2009: software installation in GNU/Linux is still broken -- and a path to fixing it" by Tony Mobily.

As I don't have an account at FSM and don't intend to open one today, I will post a response here, where noone will ever notice it. Because that's how self-confident I am. I warn you, this response is full of proof-by-assertion and invalid generalizations, but hey, it's opinion.

It starts with an interesting claim:

And yet, software installation in GNU/Linux is broken. No, not broken… it’s terribly broken. Why is that, and what can be done to fix it?

I intend to show how there is one little problem with that statement: reality. As in "what's the most successful software delivery platform for 'normal' users in 2009, and why that matters here" reality (hint: it's not windows, it's nothing on a Mac).

I mean the iphone, and its App Store. And what he is proposing is abandoning something that works a lot like it, and go back to the cave-age "download this from the app's site" model windows uses.

He describes the usual installation procedure, be it apt, yum or pacman, almost all distros do the same thing nowadays, then starts describing the problems.

  • Users need to have root access in order to install a piece of software; no per-user installation is allowed

This would have been a problem in the old days of shared computers. Nowadays, you are root, or (in some cases) root's mom. All modern distros use sudo so you don't need root access, you just use your own password (or no password at all).

So, this is a non-issue.

  • It’s very tricky to install several versions of the same piece of software. Just think of the poor graphic designer who needs to install several versions of Opera and Firefox; Users are stuck with the piece of software installed system-wide;

How do you install iFart 1.0 and 2.0 in an iphone? Can you? Special users (like graphics designers) should be provided by special solutions, like portable firefox. Think there's a need for it? Go ahead, it's maybe one day of work.

  • The software needs to be downloaded from the official repositories. Well, it doesn’t need to, but an average user wants to stay well away from unofficial repositories for technical reasons;

The iphone software needs to be downloaded from the app store. That has not hurt anyone (other than app developers, I mean)

  • In some cases (especially when the user adds repositories or installs packages directly), the dependency-checking mechanism often fails and users end up with circular dependencies. They are nasty;

I have not seen a circular dependency since 2003. But hey, maybe they do exist. In that case, don't do that.

  • A piece of software is bound to a specific distribution, and — what’s worse — to a specific version of that distribution too. It’s not trivial to install Openoffice 3.1 on Ubuntu 8.10. You can argue that you can install the bunch of .deb packages from OpenOffice’s web site. Tell that to your grandmother or your average inexperienced computer user.

Some iphone apps will not work without the 3.0 firmware. Solution? Upgrade your firmware. How's that different in Linux?

  • It’s not trivial to “give” a program to a friend. To the end user, giving a program to a friend should be as simple as dragging an icon onto a memory stick; instead, files are scattered all over the system.

It'seven simpler than that: here, let me give you rst2pdf for ubuntu: "Tony, install rst2pdf, it's in 'universe'". I don't even need to give you a floppy disk or whatever kids use these days.

Oh, and "how do you give someone an iphone app?"

Then, he proposes solutions, which I think are worse than the status quo:

  • Users should be able to install software even without being root

Users are root, or root's mom. This is not a problem.

  • Users should be able to install different versions of the same software immensely easily

The only way to do this is to make everything static or freeze the systems libraries.

Do this for "portable" versions of specific apps if you want. Don't make the system suck, please.

  • Users should be able to run either their own version of the software, or the one installed on the system (if any)

Fine by me. OTOH, how do you do that on an iphone? You don't. Please, stop diverging from what is working in 2009.

  • It should be possible to download and install software even though it doesn’t come from an official repository

Again, the iphone doesn't, and noone cares. If you care, you are not the normal user you claim to advocate.

  • Software just needs to work — unchanged — even if it’s a bit old and it’s run on a newer distribution

Yes, I want Quick Shot for iphones with 3.0 firmware!. Again, almost noone cares, except app developers.

You are acting like a Linux user, dude!

  • It should be possible to “give” a piece of software to a friend by simply dragging an icon onto a memory stick

Just tell the guy the name of the app already!

All this is true with Apple’s OS X. They got software installation just right — although a few programs, lately, seem to come with an ugly installation process.

Noone chooses a mac for this. They choose it because it's pretty, or because they are told they are better, or whatever, but anyone actually saying "hey, on a mac I can give you Office by sharing this 800MB dmg!"? Not only noone does it, it's freaking illegal.

Besides, you give the dmg to your friend, and 92% of the time, your friend has windows or Linux and can't use it. So your chance of success is about 8%.

Imagine if it only worked if your friend's computer was an Acer? There you would have a 10.5% chance! (see here) Noone would say that's good!

No, sharin apps like that is not the problem.

Please, dear linux distro developers, look around you, and see what works in 2009.

Amazingly, what works looks an awful lot like what we have been enjoying since 1998 or whatever, so let's enjoy it and make it better, instead of trying to become like a mac, or like windows, old style platforms in the age of the smartphone and the netbook.

UPDATE: you can check more comments about this story in reddit, lxer and OSNews.

2009-06-21 05:35

About 80% of what's wrong with Linux users, all in a post

My post about Arch Linux from yesterday got posted at tuxmachines and there was a comment there.

I can't reply at the site because:

  • It requires login.
  • I can't find a place to get an account.
  • It has freaking google ads popups

So I reply here because:

  • Hey, it's my own blog, so I can do whatever I want.

Here's the comment by hussam with my (admittedly ranty) response:

I've been using ArchLinux as my only distribution/operating system since early 2006. It is really a good distribution but lately there have been a lot of really bad choices which I call bad compromises:

1. Too many ArchLinux users think gnome/kde are bloat and instead install some half developed window manager and some terminal emulator and call it a "minimalist" desktop.

Why is that any of your business? And what "compromise" is there?

2. Optional dependencies are the worst idea ever. If a package is linked against libsomething.so then libsomething should be a dependency not an optional dependency. Making libsomething an optional dependency just because "minimalist" users don't want to install dependencies is plain stupid.

That's not what optional dependencies are for. For example, consider the example I mentioned, rst2pdf. It can use pythonmagick. It can also not use it. You will lose one small feature that AFAIK only one person ever used. If you need that feature, the manual tells you what to do: install pythonmagick.

Maybe there should be a pacman option "install optdepends" which turns optional dependencies into regular ones. That would make you happy and keep others happy too.

3. Bad leadership. Aaron is fantastic guy but I know at least two ArchLinux developers who can do a much better job.

That's just stupid and mean.

4. Too many ArchLinux users now like badly automation scripts like yaourt or whatever it is called.

Parse error. And then again: yaourt is great. You don't like it? Act as if it doesn't exist and be happy. You seem to have a big problem ignoring people who disagree with you. That's a really, really serious personal flaw. I suggest you grow up.

5. Too many noobs who do dumb things like people adding their users to hal, disk and dbus groups.

Sure, they should add themselves to optical and storage. So what? It's a simple problem and it has a simple solution.

Then again, the adduser scripts probably should do that for regular user accounts. After all, who wants to create a regular user that can't use removable storage? And if said use case exists, that should be doable by removing the user, and not viceversa!

On the other hand, I don't give a damn, because I can fix it trivially.

The main reason why I don't think I will switch to another distribution soon is that creating Archlinux packages from scratch is very easy and the initscript system is really fantastic.

All in all, ArchLinux is a really strong distribution now and it's constantly growing.

I expect you, like most elitist poseurs, will run away when you feel Arch is too popular and accessible to "too many noobs" or some similar nonsense.

Which, like the title says, is why you are a big part of what's wrong with Linux users.

2009-06-20 13:06

Why I STILL use Arch Linux

Yesterday I had one of those moments where I feel very happy about my distro of choice, Arch Linux. Since the last time I posted about Arch seems to have been over two years ago (time flies when you are having fun!), I think it's time to explain it.

I wanted to test rst2pdf against reportlab from SVN, wordaxe from SVN and docutils from SVN, and I wanted it to be simple.

Solution: I just packaged them in AUR!

Now, whenever I need to check rst2pdf agains wordaxe trunk, I just need to yaourt -S python-wordaxe-svn and I can go back to stable wordaxe with yaourt -S python-wordaxe.

The svn package will always be the current trunk without any modifications, and I can switch back and forth in about 45 seconds, without messing up my system's packages.

Also, I can keep my installed SVN packages updated by doing yaourt -Su --devel every now and then.

How would I have done that using Debian or a RPM distro? I suppose by going around the packaging system (which I hate) or by doing a private repo (which is so ... lame?) or by doing a public repo (which is freaking work).

Really, if you are a coder, I can't think of a Linux distro that makes life easier than Arch. Pretty much everything is there (12K packages in unsupported!) and if it isn't, it's a 5-minute job to slap it into AUR and help the community.

Suppose you are doing a KDE app. On most distros you need to install your own from-source copy of kdelibs to have the latest and make sure it's not screwed by distro-specific patches.

On Arch? Patching upstream is frowned upon. Not having the latest version is frowned upon. So it's pretty much the ideal environment to develop against KDE, or GNOME, or PyQt or whatever.

If my life was not 150% committed already, I would try to become an Arch developer, or at least a TU (Trusted User). Maybe next life!

2009-06-19 19:13

Rst2pdf 0.11 released!

It's my pleasure to announce the release of rst2pdf version 0.11, available at http://code.google.com/p/rst2pdf/downloads/list

Rst2pdf is a tool to generate PDF files directly from restructured text sources via reportlab.

This version includes many bugfixes and some new features compared to the previous 0.10.1 version, including but not limited to embedding PDF images, much improved image sizing, nicer list layouts, better styling, page backgrounds, and more than 15 bugs fixed. A full changelog is included at the bottom of this message.

Rst2pdf aims to support the full restructured text feature set, and is very close to that goal, while also including some of the more experimental features, like a source code directive with syntax highlighting and math notation support with LaTeX-like syntax.

It supports embedding arbitrary fonts, both True Type and PS Type 1, both raster and vector images (including SVG), page transition effects, multiple, flexible page layouts, cascading styles, and much, much more.

You can find more information about rst2pdf in its home page ( http://rst2pdf.googlecode.com), and ask anything you want in the rst2pdf- discuss mailing list (http://groups.google.com/group/rst2pdf-discuss)

Here are the changes in this version compared to 0.10.1:

  • Degrade more gracefully when one or more wordaxe hyphenators are broken (currently DWC is the broken one)
  • Fixed issue 132: in some cases, with user-defined fontAlias, bold and italic would get confused (getting italic instead of bold in inline markup, for instance).
  • New stylesheet no-compact-lists to make lists... less compact
  • SVG images now handle % as a width unit correctly.
  • Implemented issue 127: support images in PDF format. Right now they are rasterized, so it's not ideal. Perhaps something better will come up later.
  • Fixed issue 129: make it work around a prblem with KeepTogether in RL 2.1 it probably makes the output look worse in some cases when using that. RL 2.1 is not really supported, so added a warning.
  • Fixed issue 130: use os.pathsep instead of ":" since ":" in windows is used in disk names (and we still pay for DOS idiocy, in 2009)
  • Fixed issue 128: headings level 3+ all looked the same
  • Ugly bugfix for Issue 126: crashes when using images in header + TOC
  • New tstyles section in the stylesheet provides more configurable list layouts and more powerful table styling.
  • Better syntax highlighting (supports bold/italic)
  • Workaround for issue 103 so you can use borderPadding as a list (but it will look wrong if you are using wordaxe <= 0.3.2)
  • Added fieldvalue style for field lists
  • Added optionlist tstyle, for option lists
  • Added collection of utility stylesheets and documented it
  • Improved command line parsing and stylesheet loading (guess extension like latest rst2latex does)
  • Fixed Issue 67: completely new list layouting code
  • Fixed Issue 116: crashes caused by huge images
  • Better support for %width in images, n2ow it's % of the container frame's width, not of the text area.
  • Fixed bug in SVG scaling
  • Better handling of missing images
  • Added missing styles abstract, contents, dedication to the default stylesheet
  • Tables style support spaceBefore and spaceAfter
  • New topic-title style for topic titles (obvious ;-)
  • Vertical alignment for inline images (:align: parameter)
  • Issue 118: Support for :scale: in images and handle resizing of inline images
  • Issue 119: Fix placement of headers and footers
  • New background property for page templates (nice for presentations, for example)
  • Default to px for image width specifications instead of pt
  • Support all required measurement units ("em" "ex" "px" "in" "cm" "mm" "pt" "pc" "%" "")
  • New automated scripts to check test cases for "visual differences"
  • Respect images DPI property a bit like rst2latex does.
  • Issue 110: New --inline-footnotes option
  • Tested with reportlab from SVN trunk
  • Support for Dinu Gherman's svglib. If both svglib and uniconvertor are available, svglib is preferred (for SVG, of course). Patch originally by rute.
  • Issue 109: Separate styles for each kind of admonition
  • For Issue 109: missing styles are not a fatal error
  • Issue 117: TOCs with more than 6 levels now supported (raised limit to 9, which is silly deep)

2009-05-29 14:40

rst2pdf progress report

Since the last release, there have been many changes, improvements and fixes in rst2pdf.

At the bottom of this post you will find (maybe incomplete) list, but I wanted to share a couple of relatively large advances.


Presentations

I have wanted to make rst2pdf useful for presentations for quite a while. And now it's getting close.

I am writing a small tutorial about it, but you can see a demo already.

The changes that make this possible are:

  • Fixed bugs regarding page layout
  • Added support for page backgrounds (including SVG!)

This was in large part because of César Rodas, who wanted something simple and text-based to do his ZendCon presentation, so he asked me about it, and I was ashamed to give him a broken tool.

See how that works? I am driven by embarrassment. That's embarrasing.


Major stylesheet improvements

The related changes are way too many (see below), but it also happened for a reason: I wanted to make prettier documents.

So, since most people seems to like Sphinx's style, I wanted to look similar.

Did I achieve it? Yes and no, take a look:

web-sphinx rst2pdf-sphinx

But it's just a draft, I didn't look at fonts, or weight of the headings, or even at what pygments color scheme sphinx is using.

But anyway, even this rough stylesheet made me find a dozen bugs or problems in rst2pdf.

So, the main lesson here is, please tell me what you can and can't do with rst2pdf, because there are whole areas I am not even looking at, day-to-day.


The final thing is... the next release is going to be awesome. But then again, I always say that, don't I?


Changes as of today:

  • Workaround for issue 103 so you can use borderPadding as a list (but it will look wrong if you are using wordaxe <= 0.3.2)
  • Added fieldvalue style for field lists
  • Added optionlist tstyle, for option lists
  • Added collection of utility stylesheets and documented it
  • Improved command line parsing and stylesheet loading (guess extension like latest rst2latex does)
  • Fixed Issue 67: completely new list layouting code
  • Fixed Issue 116: crashes caused by huge images
  • Better support for %width in images, n2ow it's % of the container frame's width, not of the text area.
  • Fixed bug in SVG scaling
  • Better handling of missing images
  • Added missing styles abstract, contents, dedication to the default stylesheet
  • Tables style support spaceBefore and spaceAfter
  • New topic-title style for topic titles (obvious ;-)
  • Vertical alignment for inline images (:align: parameter)
  • Issue 118: Support for :scale: in images and handle resizing of inline images
  • Issue 119: Fix placement of headers and footers
  • New background property for page templates (nice for presentations, for example)
  • Default to px for image width specifications instead of pt
  • Support all required measurement units ("em" "ex" "px" "in" "cm" "mm" "pt" "pc" "%" "")
  • New automated scripts to check test cases for "visual differences"
  • Respect images DPI property a bit like rst2latex does.
  • Issue 110: New --inline-footnotes option
  • Tested with reportlab from SVN trunk
  • Support for Dinu Gherman's svglib. If both svglib and uniconvertor are available, svglib is preferred (for SVG, of course). Patch originally by rute.
  • Issue 109: Separate styles for each kind of admonition
  • For Issue 109: missing styles are not a fatal error
  • Issue 117: TOCs with more than 6 levels now supported (raised limit to 9, which is silly deep)

2009-04-29 21:49

Planet LUGLi

In 1997 I was one of the founding members of a LUG, called LUGLi.

I left the group a few years ago, but I have rejoined their mailing list recently.

Since I officially Know Everything About Rawdog (TM) I offered to create a planet for member blogs. And here is Planeta LUGLi.

It's heavily based on my work for Planeta PyAr and, just like it, its configuration and data is hosted in github in case of my sudden death (and because there is no point in making it difficult to help me ;-).

Contents © 2000-2019 Roberto Alsina