Blog Atom feed

Image concatenation with Imagemagick

Concatenation of multiple images can easily be done with tools such as GIMP, but easily doesn't always mean fast. So let's assume that we want to tile some images, e.g. to create an image sprite we will use on our webpage. And assume we want to do it fast.

So, instead of copy-pasting all images into the sprite, or opening them all as layers and moving them, and opening, and moving, and so on, we're going to use a command line tool, that will do all the work for us.

We will use an extremely powerful tool: Imagemagick, so if you don't have it installed yet, please do it now.

The simple way

The convert program with append option, allows you to append images one after another, vertically or horizontally. So:

...

» read more

Intel KMS and setting correct DPI in xorg-server-1.7.*

Today I switched from xorg-server-1.6.5 to xorg-server-1.7.6, as it is now available in portage and considered as stable.

Paweł Hajdan's advice, I've found on Planet Gentoo, allowed me to avoid all the driver problems, such as broken keyboard or touchpad.

But major xorg-server update without any problems would be boring, wouldn't it? ;)

Awfully small fonts

After the update all fonts became smaller and much harder to read and didn't look much better after increasing font size in Openbox, GTK, etc... And changing font sizes everywhere is clearly the opposite of a good solution.

Setting correct DPI

To check your current screen resolution, size and DPI...

» read more

Normal distribution and histogram in R

I spent much time lately seeking for a tool that would allow me to easily draw a histogram with a normal distribution curve on the same diagram. I could create the histogram in OOCalc, by using the FREQUENCY() function and creating a column chart, but I found no way to add a curve, so I gave up. I started searching for something more powerful than OpenOffice. Of course, no Windows applications were allowed.

I googled my problem up before trying to use Maxima or something similar, and I found R. I haven't heard about the R project earlier, but I decided to give it a try. And it was worth trying. Even if I were able to do the same in Octave or Maxima, I don't think it could have been done easier.

Installation

In my cas...

» read more

Fixing broken Python on Gentoo with Paludis

Have you ever run a script that should do some things you wanted it to do, but instead you ended up with your system partially messed up? Unfortunately, such things do happen.

I have no idea how simple setup.py script could destroy Python libraries, but Gentoo with messed up Python (and furthermore, with unusable Portage) didn't seem to be useful. So I had to find a solution.

The first attempt

It would be great, if I could just simply re-emerge dev-lang/python-2.6.*, but as I already said, portage was broken.

I tried to reinstall Python manually, but with no luck. Python 2.5, other portage versions, etc. - still no luck.

I decided not to use a LiveCD, because fixing it without reboot seemed to be a nice challenge.

So I came up with...

The final solution

...

» read more

And developer said: "Let there be a website"...

...and there was a website.

So.. uhm..

It's intended to be, as the header says, my place on the web, and (as the header doesn't say) my little playground. A place to write about some topics that I have on my mind, and, by the way, a place to test some Ruby on Rails features in production environment.

Of course, current version of this site has some flaws and drawbacks. I'll try to improve it over time, because some features (such as RSS, better blog URLs, OpenID auto-registration, etc.) are still missing.

It's also possible that some of the features I'm going to implement, will be interesting enough to write a few words about them, and post them on this blog.

Time will tell, whether creating this webpage was a good choice. I hope it was.

» read more