Freetype with Bytecode Interpreter

I am the maintainer and writer of most of the official Linux Font-HOWTO [official home], and one of its main points is to explain what is the TrueType Bytecode Interpreter.

I spent some time this morning updating the freetype package on my system [get RPMs], compiling it with support to BCI, and I took the chance to get some “before & after” screenshots of Konqueror browser accessing Google Mail with and without BCI.

Check it out. This is better than makeup ads:

Before: Original Freetype lib without BCI After: New Freetype RPM compiled with BCI
freetype4-nbci.png freetype4-bci.png
freetype1-nbci.png freetype1-bciaa.png freetype1-bci.png
freetype2-nbci.png freetype2-bciaa.png freetype2-bci.png
freetype3-nbci.png freetype3-bciaa.png freetype3-bci.png

After switching to BCI-enabled freetype, the use of Webcore fonts without anti-aliasing gives much much much better results, as you can see. Unfortunately these fonts are not free, but they are better than the popular Bitstream Vera fonts because they include hinting information.

BTW, anti-aliasing is useful in 2 situations only: if you are rendering fonts in big sizes (bigger than 13px), or if you have bad, non-hinted fonts (as Bitstream Vera) with a bad font rendering library (as Freetype without BCI support). If you have good hinted fonts and a good rendering library (as Freetype with BCI), restrict anti-alising only for big font sizes.

My Podcasts

A podcast is a blog that, in addition to text, also publishes media files. So you need a special “reader” to listen them, so people use softwares like iTunes, Amarok, iPodder to subscribe and automatically get the media.

I’m officially releasing my podcasts here, posting songs in high quality MP3 format. These are the channels, subscribe using the orange buttons below:

Enjoy.

Parafuso

Parafuso is an instrumental masterpiece by brazilian Ronen Altman, played by the Orquestra Popular de Câmara.

OPC sort of brought a globalization conscience to brazilian instrumental music, mixing together a great number of instruments and musical styles. They are in evidence in the innovative tradition of brazilian jazz from São Paulo.

If this song was a building, it would look like modern architecture: functional, beautiful, strong and light.

Enjoy.

Internet Music Download

It is very controversial if it is illegal or not to download music from the Internet. The law and license to use a phonogram (a CD track) is not clear for the masses, or nobody never explained it precisely.

Understand the Context

I met a professional musician once that was studying musical production in the university, and he outlined some aspects very clearly:

  1. The great recording companies provide a service for the society in this ways: finding talents, funding the production and recording of the phonogram, producing a nice CD booklet, advertising the product on TV, radio, magazines, outdoors and operating the physical distribution logistics of the CD, all of this for you to listen high technical quality music, and easy to find in a store near your home. So nothing is more fare for the recording companies to get their financial share.
  2. Because of this a recording company is, in general, the owner of the phonogram (a CD track), and not the musician or composer. That means that the company decides when, how much and how they will publish these songs (publish means to create CDs and put them in stores). The musician can’t take a phonogram on which he participated on the recording, put it on a media (CD, tape, DAT, long play, etc) and start selling it, unless he buys the rights over the phonogram, that are, in general, very expansive.
  3. The recording industry and companies are not defending the artists rights, but their own interests. In fact, many artists do not like that the recording companies say they are defending their rights.
  4. In all this commercial process, musicians share come from their authorship rights (which is small, according to some musicians I know), that comes from an independent institution, which in its turn comes from the recording company and other sources. This rule is not the same for big stars that have enough power (and agents) to negotiate better contracts with a recording company.
  5. The musician wants his art to be known and listened in the broadest way possible.
  6. Professional musicians earn more money making shows and live performances, and less in the process of selling recording company’s CDs that carry his creations.
  7. People will only pay for show tickets if the artist’s creation is good and well known.
  8. Many good artists don’t have market penetration, money or disposition to record CDs in a way that they will own the phonograms (the so called independent way). These are usually referenced as “alternatives”.
  9. Excellent musicians and beautiful phonograms can be unknown to the point it is considered not viable to give them space in a CD store shelf. Because of that it is difficult to find old recordings or the so called “alternatives” in stores: or people already changed their taste, or the number of people will buy is very small.
  10. I estimate the cost to mass produce one single CD — including the plastic, media, booklet and its artwork, authorship rights, some advertisement etc — in about US$2.
  11. I heard that the law prohibits the redistribution of phonograms (CD tracks) in a physical media (to burn a CD or tape and start selling or buying it).
  12. The Internet is not considered a physical media. So in this rationale, by law terms, it is not prohibited to use the Internet as a way to distribute music, at least for phonograms produced/recorded before the Internet era, which includes everything before around 1997. After that, phonograms started to be produced with a revised license (the law terms of what is permitted or not to do with it) that considered the Internet.

Whatever they say, to download music from the Internet takes time, comes without the booklet — which contains a lot of art and valueable information — and is controversial if it is illegal or not. On the other hand, artists and their full high-fidelity discographies have been seen in such a way that seems not rational not to download.

You should decide if you follow what the media says defending their rights — and not the artists’s —, or if you are going to give prestige to a musician and feel all its creative potential can make with your emotions.

How to Download

I opened this space for a friend to explain how to do it. This method uses the Bit Torrent technology and these are the steps to successfully use it:

  1. Download and install some Bit Torrent software as BitComet (only for Windows) or Azureus (Mac, Linux, Java, Windows). These software are free, safe, will not install spyware, virus, malware etc, and their use is completely legal.
  2. Use the www.isohunt.com website to find music by name, artist, etc. It can be used to find also other types of files. You can also search the Internet for other sites that provides “torrents”.
  3. Search, for example, for “Mozart” or “Bach“, etc. Click on these links to see a search result example.
  4. You will find complete collections and very large files, that takes sometimes days to download. The first results isohunt will show are the most active downloads, and because of that faster to download.
  5. Select the item you want, it will expand, and then click the link called “Download Torrent” to start the download.
  6. This will trigger the Bit Torrent software (BitComet of Azureus you downloaded above), that will ask you where you want to download. Choose a directory that you will remember later.
  7. Before selecting OK, you will see a list (huge if it is a complete collection) with the files included in the torrent, and you can select only the files you want, or everything.
  8. Monitor the download activity and guarantee you are downloading in a good speed. If it is constantly slow for a long time, it is usually better to cancel and search for another download.
  9. Even very fast downloads can take days to be fully retrieved if it is big.
  10. After the download finishes, if you use Linux, use Musicman to organize your retrieved files.

Be responsible and good luck.

Choosing a Linux Distribution

It is important to begin by saying that all Linux distributions, including commercial — Red Hat Enterprise Linux, SUSE, Xandros, etc — as well as non-commercial — Debian, Slackware, Gentoo, etc — are all good and are technically able to fulfill most real world needs. To choose amongst them is more related to personal taste of the people who already knows it than to functionality. But a company must think about other aspects — not only taste — to guarantee making the right strategic choice for long term benefits.

Support and Certification

All Linux distributors package, in one way or another, mostly the same set of Open Source softwares (the Kernel, Apache, Samba, libraries, Gnome, KDE, etc). But only the so called enterprise distributions include support services together with their product.

For a user, support really means:

  1. A partner available now and in the long term to transfer operational risks.
    This is the most important point. Companies don’t want to take risks — specially the Open Source risks — for themselves.
  2. Fast access to quality updates.
    Companies in general have limited resources to compile, test and apply OSS updates.
  3. Access to a large set of certified hardware (IHV) and software (ISV) vendors, and availability of pre-tested complex solutions.
    A critical part of any IT project is the support and certification connections between its components (hardware, storage, middleware, etc). The most important and valued function provided by a distributor, even more so than the embedded technology in the OS, is its ability to build ecosystems of certified Independent Hardware and Software Vendors.

Price for a License Versus Subscription Business Models

Companies that sell commercial software (as Microsoft, IBM, Oracle, etc) allow somebody to use their products only after buying the rights to. This “buyable rights” are refered to as a commercial license.

The software provided in any Linux distribution is free of charge. The developers of these softwares have licensed their work under the GPL, BSD, Mozilla Public, IBM Public or some other Open Source licenses, which grants anyone the rights to use and redistribute the software without having to pay any money.

It is a misnomer to say that you are “buying� some Linux distribution (or a license for it to be used). You can’t buy it. It is already yours, in practical terms. It is like saying a user is buying the content of some web site. There is nothing material to acquire. On the other hand this user can subscribe to a service that provides hot line support, access to updates and access to an ecosystem of interoperable certified products and solutions – the support points outlined above.

So enterprise Linux distributors (such as Red Hat, Novell, Xandros) sell these services, and not the software, because the last is free of charge.

Choosing the Best Distribution

There are two responsible and effective ways to use a Linux distribution as part of a company’s IT operations:

  1. Acquire a global commercial Linux subscription such as Red Hat Enterprise Linux or Novell SUSE Linux Enterprise Server.
    A subscription ties together the Open Source software and its global scale support, providing a stable environment for a certified ISV and IHV flourishing ecosystem.
  2. Use free distributors such as as Debian or Slackware and buy support services from an independent local company.
    Free distributions may introduce more risk due to non-global support operations, in addition to a loose integration between software and support, which leads to a weak ISVs and IHVs ecosystem.

In terms of technical flexibility and vendor choice — points that influence cost —, both options are equal. All the benefits of the second option are present in the first, while second lacks the ecosystem aspects.

Thus the conclusion is that it is more reasonable to directly acquire a product that directly ties the support to the software, than manually integrate them at the regional level.

RHEL versus SLES comparison

Companies should look at the following points, in this order, when choosing a Linux distribution to run their business applications:

  1. Which distribution vendor do I have closer commercial relationship?
  2. Who has best pricing model for the value provided?
  3. Which distribution does my technical staff have more experience with?
  4. Which distribution is supported and certified by my providers of hardware and software?
  5. If you are unsure, be responsible and use an enterprise distribution.

There are two enterprise Linux distributors that have a strong ecosystem and penetration in the market: Red Hat Enterprise Linux and Novell SUSE Linux Enterprise. They have differences that every year continue to converging and diverge. See the table for a comparison.

Other Enterprise Distributions

There are several Linux distributions with business models similar to the one adopted by Red Hat and Novell. Most well known are Ubuntu (technically based on Debian), Mandriva (Conectiva and Mandrake fusion), Xandros (also based on Debian.) They are focused on building a product that can scale globally in such a way that support services can be delivered automatically or as a self-service.

There is an intrinsic market law that seeks equilibrium by providing two options in which to choose. One option may be good (there is actually no option when only one path is available), two mature options is better, and three or more options are too much for the market to handle. It appears that the market has already defined its two mature options: Novell and Red Hat.

Even if these other enterprise distributors have better products, they’ll have to spend a considerable amount of energy developing an ecosystem of ISVs and IHVs. More than that, ISVs and IHVs will have to take a break in their operations to listen to what these new distributors have to offer.

Ecosystem is everything. A product with a good ecosystem can easily become much better than an excellent product without an ecosystem. This is probably the most important aspect a company should consider when choosing a Linux distribution.

One cannot say that a certain distribution is better than all others. When searching for a distribution one should be pragmatic in striking a balance between the distribution’s functions and how well it meets the goals of the company or specific project.

Google Maps Plugin for WordPress

This software will let you easily render Google Maps anywhere on your blog as a web service. It also includes code for easy integration with WordPress blogs, but what the code does best can actually be used with any other blog system or plain web page.

This plugin will let you easily create from simple maps with one marker and a text balloon, to complex multimarker maps with hypertext balloons as this page.

Installation on WordPress Blogs

Install it as any other plugin (unziping plugin files under [WORDPRESS_ROOT]/wp-content/plugins directory and activate it in WP Plugins admin tool). Then go to the Google Maps API key signup page, get an API key for your website, and install it in the plugin’s admin page under Options.

Google Maps WP admin page

Creating Simple Maps

This is the easy part.

  1. Go to Google Maps, find the spot you want to show, select Map, Satelite or Hybrid view buttons, double-click on the most important point on the map to centralized it, and define the zoom factor you want.
  2. On the left-top corner of the map, click on the “Link to this page” link, and copy your browser’s location to the clipboard. You can do the same for complex maps created on the My Maps section of Google Maps website.

    Link selection

  3. While creating the post, select the text that will be displayed on the map marker, and create a link with it.

    Select text for the map's mrker

  4. Paste the map URL on the Link URL field, and on Title write “googlemap“.

    Link creation dialog

  5. Continue editing your post and publish.

You are done. This example will render a map like this (don’t forget to click on the marker to see the balloon):

TuxThis will be a map’s marker text with an image.

Passing Parameters

You may have noticed that on the Title field above we used other commands. In fact you can use the following switches, separated by “;” to control the way the map will appear in your site.

googlemap
Instructs the plugin to transform this link into a Google Map area. If not used, the plugin will not work on the link and you’ll get a plain link to the Google Maps site.
nocontrol or nocontrols
Renders a map without the zoom and scale controls
nomarker or nomarkers
Renders a map without the marker with the information balloon.
w:SIZE_IN_PIXELS and h:SIZE_IN_PIXELS
Defines the size of the map area in pixels.
w:PERCENT% and h:PERCENT%
Defines the size of the map area relative to full width and height.

Since other plugins may use the title attribute, you can also put these commands in the rel attribute and activate this functionality in the plugin configuration dialog.

Some examples for the Title (or rel) field:

googlemap
Renders a map with controls, marker an default sizes, as specified in the plugin’s admin page, under WP Options.
googlemap;nocontrols;w:300;h:200
Renders a 300×200 map with marker but no zoom controls.
googlemap;nomarker;nocontrols;w:100;h:100
Renders a small 100×100 map without marker and zoom controls.
googlemap;nomarker;nocontrols;w:100%;h:300
Renders a maps that fills the full width available with a 300 pixels height, without markers and zoom controls.

Creating Complex Maps

This procedure requires some HTML knowledge, but will let you create maps with multiple markers, and results as good as on this post.

The proccess consists of creating a definition list (<dl> XHTML element) of a center point and markers with their text balloons.

Learn by example. Pay attention to the following complex map, and select all its markers to see the text inside their balloons:

Center of map
map
Center of São Paulo
map
Flea market
map
Traditional market
balloonless marker
map
Japanese town

It was generated by this (X)HTML code:

<dl title="googlemap;w:100%;h:400">
	<dt><a href="http://maps.google.com/?z=15&ll=-23.550887,-46.631985&om=1">Center of map</a></dt>

	<dt><a href="http://maps.google.com/?ll=-23.550592,-46.633122">map</a></dt>
	<dd><strong>Center of São Paulo</strong></dd>

	<dt><a href="http://maps.google.com/?ll=-23.547563,-46.631041">map</a></dt>
	<dd>Flea market</dd>

	<dt><a href="http://maps.google.com/?ll=-23.54535,-46.627693" title="marker">map</a></dt>
	<dd>Traditional market</dd>

	<dt><a href="http://maps.google.com/?ll=-23.54715,-46.637263">balloonless marker</a></dt>

	<dt><a href="http://maps.google.com/?ll=-23.555195,-46.635547" title="marker">map</a></dt>
	<dd>Japanese town</dd>
</dl>

So the structure must folow these rules:

  1. Create a definition list (<dl>) and put map-related commands and parameters on title= attribute as specified above.
  2. First definition term (<dt>, first green line) must contain only a link to Google Maps site, to define its center and other map parameters. The text for the link is ignored when a map is generated, so use a text like “Center of Map” so people accessing your posts outside your blog (for exemple, through feed readers) will have a clue what is this link for.
  3. The rest is a pair of terms and definitions (<dt> and <dd>) with the marker position (as a Google Maps URL) and the text on the balloon respectivelly.
  4. You can create a balloonless markers specifying only a <dt> without a <dd>.
  5. Whatever you put inside the <dd> block will appear inside the balloon. Put links, images, lists, tables, etc.

Using Google My Maps or KML and GeoRSS maps

You can use Google My Maps service to create and manage colorfull markers, paths, regions and the text inside the balloon, and simply use the “Link To This Page” link to embed the map in your page as described above.

The plugin will use the KML-exported version of your map to create the balloons, markers, regions and paths. Simply exaplained, KML is XML dialect that contains all meta information of your maps: markers positions and images, line colors, balloon texts, etc. You can create KMLs with tools like Google Earth, Goole Maps or even using a plain text editor. GeoRSS format is also supported but can’t be used for paths, regions and markers colors, only plain geographical positions.

The good news is that you can embed KML-maps from any source, and not only from Google My Maps. You can upload a KML file to your web server and pass it to the plugin to render it. Here is an example on how to do it in a more advanced way:

<dl title="googlemap;w:100%;h:400" id="my-wonderful-map-with-kml">

	<dt><a href="http://maps.google.com/?z=7&ll=-23.550887,-46.631985&om=1">Center of map</a></dt>

	<dt><a title="kml" href="http://my.server.com/spots-on-the-farm.kml">markers</a></dt>

	<dt><a title="kml" href="http://my.server.com/spots-on-the-beach.kml">more markers</a></dt>

</dl>

This example will render a map centralized on geo position -23.550887 -46.631985 and overlay it with two KML specifications: spots-on-the-farm.kml and spots-on-the-beach.kml. Note the required title=”kml” parameter that indicates to the plugin that this is KML or GeoRSS overlay and not a plain marker position.

Positioning and Style Possibilities

To have better control over the map positioning and overall look, you can manually edit the HTML code while posting, including style and class attributes. Find the <a> or <dl> tag for your link and use this examples to get some clues:

  • <a style=”float:left; width:300px; height:300px;” title=”googlemap”
    Renders a 300×300 map floating on left of the paragraph. See example.
  • <a class=”photo” style=”float:right;” title=”googlemap”
    Renders a map with default dimensions floating on the right of the paragraph, with style class photo, that in my theme defines some margins and borders.
  • <dl style=”visibility: hidden;” title=”googlemap”
    Using style=”visibility: hidden” will make the browser hide the map definititon text while loading the page. Seconds later, when the plugin renders the maps on your page, the hidden blocks will finaly appear as maps.

The HTML attributes id=, style= and class= you specify will be inherited by the generated map.

In addition, a CSS class called map will be added to all maps, and to all balloons a CSS class named balloon will be assigned. This way you can define your own style for these elements.

Troubleshooting

Some common problems people have, and solutions.

  • Map does not appears or appears on a different geo locationMake sure the Google Maps URL you are pasting is correct and complete. A correct URL must have the following parameters: ll= required to define latitude and longitude for center of the map or a marker, om= option to show or not the overview map on bottom-right, z= required to define the initial zoom factor, t= option to define if map is plain, satellite or hybrid, msid= required if you are pasting My Maps from Goole Maps website.
  • Problems with &You should not have problems with & chars being modified by the WordPress editor. If so, it means you are working with complex maps. Yes, WordPress WYSIWYG editor sucks a little bit. So if you are working with complex maps, you should switch to the plain text editor. You can’t just open the post editor in WYSIWYG and select the plain text editor after that. The mess was already done. You will have to edit your profile under Users->Your Profile and deselect the “Use the visual editor when writing” options when you edit that post. Once it is saved you can reselect it again.
  • Grey area instead of markers, or simply don’t have markersGoogle Maps API uses a lot of CSS style to render its maps on your page. This problem is caused by a conflict between CSS needed by Google Maps and your page or theme defined style. Use Firefox’ DOM inspector to drill down into your document structure until you find the markers XHTML nodes. Then switch to CSS Style Rules mode on the inspector, then select a rule that was defined by your theme, on the top-right box, then delete “background-” related properties on the bottom-right box, one by one, until the marker appears. This will indicate you which property you have to delete from your theme’s or own style.css file.
  • Problems displaying the map on IE7

I still don’t know what is the problem here. I rarely use Windows nor IE, so I can’t reproduce it. This is probably caused by the same CSS conflict above. If you can correctly see the map on this page with IE7, indicates that the problem is specific to your page and related stylesheets. You must debug your CSS styles.

No WordPress ?

If you use other blogging systems, or just want a simple way to create maps on your pages you can still take advantage of this plugin.

Download the plugin, unzip, install its content somewhere on your server accessible from the web. Then edit the HTML source of the pages you want to render maps, find the <head> block, and include the following code inside of it:

<!-- Google Maps Plugin (begin) -->
<!-- http://avi.alkalay.net/2006/11/google-maps-plugin-for-wordpress.html -->

<!-- Google Maps API -->
<script src="http://maps.google.com/maps?file=api&v=2.x&key=MY_API_KEY" type="text/javascript">
</script>

<!-- Google Maps Plugin logic -->
<script src="http://my.site.com/path/to/plugin/googlemapsPlugin.js" type="text/javascript"></script>

<!-- Google Maps Plugin initialization -->
<script type="text/javascript">
	//<![CDATA[

	MapPluginInit(
		/* Default maps width  */          500,
		/* Default maps height */          300,
		/* Use rel instad of title? */     false);
	//]]>
</script>

<!-- Google Maps Plugin (end) -->

Change the red parts to fit your needs. Every page containing the above block will be able to render simple and complex maps as described.

About

This plugin was inspired on Macdiggs Google Maps plugin, but was completely redesigned, rewritten, has much more functionality, made more user friendly, has cleaner code and is more standards oriented. The former Macdiggs’ plugin will not receive updates anymore so this is the plugin you should be using.

Soleil Theme for WordPress

Soleil screenshot

The Soleil theme for WordPress was based on the original creation and colors by designer Carrie Petri for other blog systems. I just mixed the PHP code and some technical ideas thowards what a blog system should be.

Althought it looks really good, Soleil is way more than eye candy. It is unique due to this main features:

  1. Localized on demand
    The blog generic control strings will appear in visitor’s language that he set on his browser. Also, all blog-specific strings as category names, post titles and personal links may have hooks for personal localizations. See bellow how to activate this feature.
  2. Widgetized sidebar
    Soleil provides all its sidebar content as widgets. If you use the WordPress Widget Plugin, you’ll be able to visually rearrange the sidebar and also visually use more widgets from a vast network of developers.
  3. Very friendly to feed readers
    Every aspect of a Soleil blog provides clear and intuitive links and icons to its feed version. Categories archive pages, comments, list of categories on the sidebar, etc. Browse my blog to see what I’m talking about.

All artwork was completely redrawed in CAD systems and in OpenOffice.org Draw to improve images quality. The vector files are included.

Other benefits of this theme are:

  1. Shiny and vibrant colors, thanks to Carrie.
  2. Certified to work on Firefox 2, IE 6 and Konqueror. This gives a clue it will look good in any other browser.
  3. Efficient, yet well balanced use of the entire screen.
  4. Intuitive icons for reply, trackback, blog, post and category feeds, etc.
  5. Clear visual separtion between each post, each comment, etc.
  6. Shows number of comments in evidence.
  7. Direct links to post and comment editing (for administrator only).
  8. Includes a style for printing that hides parts of the page irrelevant to this media.
  9. Provide list of links with icons to popular feed readers.

Download the theme archive, unzip it in your [WORDPRESS_ROOT]/wp-content/themes directory, and select it in the Presentation tab of your WordPress admin interface. Organize the sidebar widgets (if you use the recomended Widgets Plugin) on the admin interface, Presentation -> Sidebar Widgets.

Soleil Predefined Style Classes

Soleil provides some CSS classes that I heavily use in my posts:

photo
To be used on image tags. Add margins, padding and a slim border. Use it like this:

<img class="photo" style="float right" …
command
From the docbook series and for technical writers, renders a computer command in evidence. Use it like this:

<span class="command">ls -al</span>
programlisting and screen
From the docbook series and for technical writers, renders a box with special fixed size font as a computer output or programlisting. Adds scrollbars if content is too wide, to not breake your layout. Usage:

<pre class="programlisting"> 
	// sourcecode of a program 
	code { 
		Some code 
	} 
</pre>

or

<pre class="screen"> 
	bash$ ls -al 
</pre>
filename
From the docbook series and for technical writers, renders a filename in evidence. Use it like this:

<span class="filename">/bin/kdb</span>
xmlbutton
An XML button maker, the one very popular on blogs etc. To get a button like My XML button, use as:

<a class="xmlbutton" href="http://someplace">My XML button</a>
articleinfo
Creates a nice may-be-floating box for you to show some information about the post. The box will appear in evidence but outside the stream of the text. See an example on this post. Usage:

<div class="articleinfo" style="float: right">Some info about this article.<div>

You should also use <h4> as the header for subtitles inside posts.

Displaying Links Correctly on Sidebar

Many blogs that use Soleil have their links looking bad on their sidebar. To fix this, you should go to your blog admin interface, select Links->Link Categories and edit each link category’s properties in a way that each item will be wrapped into an HTML <li> tag.

For example, my blog categories have Before Link: <li> and After Link: </li>

Soleil Localization and Internationalization

Soleil’s default language is english, and is currently localized to portuguese.
To localize Soleil to you language, go to soleil/languages and copy the theme-pt.po (portuguese language) file to theme-YOURLANGUAGECODE.po and edit it to fit your language needs. The file format is very intuitive and it contains all generic messages the theme uses.

You can also localize your blog specific strings as your category names, blog name, blog description, and even some posts titles. For this you have to edit personal-YOURLANGUAGECODE.po in the same way.

To compile a .po file, on Linux do this:

bash$ msgfmt -c -v -o theme-YOURLANGUAGE.mo theme-YOURLANGUAGE.po 
bash$ msgfmt -c -v -o personal-YOURLANGUAGE.mo personal-YOURLANGUAGE.po

The .mo files must be located under soleil/languages/ while the .po don’t have to be under your blog installation, live them in your PC only.

To activate on demand localization based on visitor’s prefered language, ensure your wp-config.php file contains this:

define ('WPLANG', substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2));

Enjoy.

Converting YouTube to MPEG or iPod

In the end of this proccess you’ll have an .mpg file on your local disk, generated from an Internet-only YouTube URL.

First make sure you have ffmpeg (video encoding and decoding tools) and lame (MP3 audio encoding and decoding tools) softwares and dependencies installed on your system. You will also require the youtube-dl scripts that downloads the actual YouTube video.

In a Red Hat or Fedora system you can install it from Dag or Livna RPM repositories, with a simple yum command:

bash# yum install ffmpeg lame youtube-dl

Then you get to the YouTube video page you want to download. In this example we’ll use the Heist video, the first Linux ad from IBM, that has http://www.youtube.com/watch?v=DO9ZWDaLLxA as its URL.

I’ll use youtube-dl this way:

bash$ youtube-dl -t http://www.youtube.com/watch?v=DO9ZWDaLLxA

And I saw it connecting to YouTube several times and downloading the video. In the end, I found a big file named the_heist-RRZyz1vXkPE.flv in the current firectory, which is the video file.

Now lets convert it into MPEG with ffmpeg:

bash$ ffmpeg -i the_heist-RRZyz1vXkPE.flv -acodec copy -sameq heist.mpg

-acodec copy will cause ffmpeg to copy the audio from input to output file, while -sameq causes the output video quality to be the same as the source, but output file will be very big. For YouTube videos, you can use -b 320000 instead of -sameq to get smaller file sizes.

I saw ffmpeg taking some time to convert, and in the end I got the heist.mpg file which I was able to confortablly play in any MPEG aware video player, as mplayer.

If you want to convert the video file into MP4, which is the format supported by iPod Video players, you just change the extension:

bash$ ffmpeg -i the_heist-RRZyz1vXkPE.flv -acodec copy -b 320000 heist.mp4

Ffmpeg will take care to use the maximum screen size available from the source (the .flv file) so the converted file will be as hi-fi as YouTube let be (not too high really).

Enjoy your video.

Samba to use Elektra for configurations

Read here before it goes broad in Slashdot.

Gerald (Jerry) Carter, Samba’s core developer and architect, initiated a Google SoC project to elektrify Samba. The project was successfully completed by Mingwang with Jerry’s mentorship. “Longer term, we (Samba) have to come to an agreement about (…) How (and to what degree) do we support legacy systems that want to continue to the the smb.conf text file. This is a pretty big shift for us. And although everyone agrees that we must have programmatic access to out configuration data from within Samba, we have to chart the course to get from where we are today to where we want to be 6 months down the road.” – said Jerry on the Elektra list while also showed a kdbedit screenshot of an elektrified Samba.

Open Source Geeks Should Read This

The title of that article is Why we won’t be talking about Open Source in the future, by an analyst called Clay Ryder, and I think is provides an insightfull and pragmatic perspective of how Open Source should be looked at by the business world. It perfectly feets what I use to say and present in events.

Here are some quotes:

While there are religious devotees who believe that the most important role of Open Source is to bankrupt Microsoft, there are many who are not on the Redmond attack squad, however, that talk about Open Source as if it remains somehow discrete, or fundamentally different than other software.

…the reality is that from a bits and bytes perspective, open source software is no different than any other. It is code that runs on the machine and hopefully solves a problem and delivers value to the end user. The development model and the pricing model vary, as do issues related to intellectual property and ownership, but at the end of the day it is just software.

Open Source software is making the same demands on the marketplace – these technologies are priceless, therefore stop trying to make money them, but instead invest those same dollars in adding value on top of the priceless technology. As a result, freely distributable, standards based, basic technology will be a given, let’s learn innovate on top of it, where the real value, and may I add, margins, will be found.

This kind of article may appeal to clients who are skeptics about Linux fanatics.

System Rescue Without a Password

So you lost your Linux root password.

No panic. There is a way to reset it:

  1. Turn the computer on and pay attention.
  2. When the bootloader (GRUB or LiLo) screen appears, select the partition you want to fix the password.
  3. Do not boot it yet. Go into edit mode for this partition.
  4. In the end of the kernel boot parameters line, include this init=/bin/bash.
  5. Then boot the partition.
  6. You will see a very fast boot. And right after the pure kernel initialization you’ll receive a root command line. If you try to change a password at this time (with the passwd command), you’ll get a message that means you don’t have write permissions on the filesystem.
  7. So you’ll have to put your system in a read-write state whit this commands:
    bash# mount /proc
    bash# mount -o remount,rw /
  8. All set. Now use the passwd command to change the root password.
  9. Now type the following: sync; sync; exit. Then reset the system.

Note: If the computer has a BIOS or Bootloader password that you don’t know, you won’t be able to use this technique.

The idea here is to change the default program that is executed to setup all the OS environment, right after the kernel initialization. By default it is /sbin/init, and what we did above is to change it to /bin/bash — a regular shell prompt, a command line.

My IT Presentations

Here are some presentations that I created and use to deliver in IBM events.
Most charts include speaker notes. They are all in Use OpenOffice.org Open Document Format (ODF).
I rarely use the full presentations, I select the best charts according to the audience.

I am also founder of the Elektra Initiative, and produced an Elektra Presentation that members of the community use to deliver in Linux events.

See also the articles I have written.

Inline Blogger.com Comment Form

  • WARNING: This script is not being supported anymore since I moved to a much better blogging system with WordPress.

If you don’t want your blog visitors to be redirected to blogger.com website just to write a comment for your post, you are in the right place.

This page will show you how to include a comment form directly into your post page, just as you can see in this very page, bellow. After installing this solution in your blogger.com blog you’ll feel an instant increase in the number of comments people write for you, because a comment form right in the face of your visitor is way more intuitive and inviting tsule with nowadays blogger.com interfaces, and stepped out from a hack status into a clean, functional and well documented solution.

PLEASE, write a comment here, including a link to your blog so people can know who else is using this solution.

PLEASE, do not make test in this post. PLEASE, leave it for real comments or support questions. PLEASE, use this post to test the form.

Installing

  1. Download this script and make it available somewhere on your website, for example from the URL http://my.website.com/resources/bloggerCommentForm.js (this is the URL we’ll use in our examples).
  2. Edit your blogger.com template and look for the end of the HTML header marked by the </head> tag.
  3. Right before the header ending include the following piece of code in a way that everything will look like:
    <ItemPage>
    <script type="text/javascript" xsrc="http://my.website.com/resources/bloggerCommentForm.js"  >
    </script>
    
    <script type="text/javascript">
    // Lets configure the comment form a little bit
    
    // Include some style
    commentFormStyle();
    
    </script>
    </ItemPage>  </head>
  4. Now you’ll have to place a call to a JavaScript method that will render the form. Scroll down and look for the section on your template that renders the comment. It starts with a <div id=”comments”> tag. This code should be included right after it:
    <a name="postcomment"></a><h4>Write a Comment</h4>
    
    <script type="text/javascript">
    commentForm('<$BlogItemCommentCreate$>');
    </script>
  5. Save your template and republish your blog.
  6. Visit one of your posts page, see if the form appears, and try posting some different comments as different users.

Configuring the Form

You can configure the form, specialy for internationalization, in a very clean way without having to change the code. For example, look how it looks in a brazilian portuguese blog post.

  1. For that, edit your template again and look for the script initialization part you just included in the <head> section.
  2. You can define some JavaScript variables that will define the form language and other parametrizations. Copy and paste these defaults to start translating:
    <script type="text/javascript">
    
    // Lets configure the comment form a little bit
    
    // Include some style
    commentFormStyle();
    
    // General parameters
    var labelWidth = 80;
    var bloggerFormActionURL="http://www.blogger.com/login-comment.do"
    var confirmBeforePost = true;
    
    // Language defaults
    var bloggerUserLabel = "Blogger.com user";
    var otherUserLabel = "Other";
    var customUserLabel = "Name or nickname: ";
    var urlLabel = "URL: ";
    var anonLabel = "Anonymous";
    var rememberLabel = "Remember Me";
    var postedByText = "Posted by";
    var commentButtonText = "Post Comment";
    var previewButtonText = "Preview";
    var previewWindowTitle = "Comment Preview";
    var confirmText = "Post this comment?";
    var boldButtonText = "B";
    var italicsButtonText = "I";
    var linkButtonText = "Link";
    var linkPrompt = "Link Text:";
    var urlPrompt = "Link URL:";
    var quoteButtonText = "Quote";
    var quotePrompt = "Use your mouse to select the text"+
    " in the comment you want to quote.n"+
    "Then press the quote button.";
    </script>

Additionally, you may want to change the target links in your template to make them point visitors to the comment form in the post page. For example, I have the following piece of code in my template that renders each post footer:

<p class="post-footer">
<em><$BlogItemDateTime$></em> |
<a xhref="<$BlogItemPermalinkUrl$>"
title="permanent link">permalink</a>
<BlogItemCommentsEnabled>
<a class="comment-link"
xhref="<$BlogItemPermalinkUrl$>#postcomment"><$BlogItemCommentCount$>
comments</a>
</BlogItemCommentsEnabled>
<BlogItemBacklinksEnabled>
<a class="comment-link"
xhref="<$BlogItemPermalinkUrl$>#links"  >links to this post</a>
</BlogItemBacklinksEnabled>
<$BlogItemControl$>
</p>

This script is free and licensed under the LGPL.
Enjoy.

High Availability Linux Clusters

Here is a light document, in the form of a presentation, to help IT architects or sales people to understand High Availability Clusters with Linux:

  • How it works
  • Components needed to build HA clusters
  • Replication
  • SCSI and Fiber Channel considerations
  • Reference architectures
  • Clustering of popular products
  • Sizing guides
  • etc

Start here and follow the links to browse it, download PDF or the original Use OpenOffice.org (ODF) file.

There are also excelent presentations and tutorials in the Linux-HA Project website.

Developers for Increased Openness Ecosystem

I’m proud to say that Rogério Oliveira, IBM Brazil General Manager, said a phrase that I keep saying inside IBM for at least 4 years.

If we build relationships with our customer’s development teams, we’ll be able to detect opportunities at least 6 months earlier than when talking only to customer’s IT infrastructure teams

Rogerio Oliveira, IBM Brasil General Manager

Development teams role in the IT environment of some customer is to be the closest point to the line of business a technology provider like IBM can and should effectively reach.

The Best Linux Distribution

Check this presentation to business and technical people about Linux Distributions. There is an article outlining the same topics that can work as a transcript for this presentation.

The topics included are:

  • What makes a Linux distributions to be what it is
  • The ingredients for success and for market failure
  • Core technologies inside a distribution
  • Important points to consider when choosing “the best distribution”
  • What “support” is, its importance, and what customers should really look for when considering comercial support for a Linux distribution
  • High level comparation between Red Hat Enterprise Linux and SUSE Linux Enterprise Server in flavor, standards adherence and stability
  • Highlights on other non-comercial distributions as Fedora, OpenSUSE, Debian, Slackware etc, and the weak-ecosystem ones as Mandriva, Ubuntu, etc
  • Colorful details about how Linux distributions work with and package Open Source software
  • The new generation of “semi”-comercial distributions

Availability:

Check also an interview I gave in a Linux World event right after presenting this:

Linux Astral Map

This is Linux atral map, which defines (for who believe) Linux’s personality and future. It was made based on the time the Linux OS was born, took from the e-mail Linus Torvalds sent releasing the first Linux version.

From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Newsgroup: comp.os.minix
Subject: What would you like to see most in minix?
Summary: small poll for my new operating system
Message-ID: 1991 Aug 25, 20578.9541@klaava.Helsinki.FI
Date: 25 Aug 91 20:57:08 GMT
Organization: University of Helsinki.

Hello everybody out there using minix-

I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I’d like any feedback on things people like/dislike in minix; as my OS resembles it somewhat (same physical layout of the file-sytem due to practical reasons) among other things.

I’ve currently ported bash (1.08) an gcc (1.40), and things seem to work.
This implies that i’ll get something practical within a few months, and I’d like to know what features most people want. Any suggestions are welcome, but I won’t promise I’ll implement them 🙂

Linux Torvalds torvalds@kruuna.helsinki.fi

The astrologist who made the interpretation said many things about Linux “personality”. Some of them:

  • He’ll have a lot of money
  • He’ll receive many many help from many many people
  • He has a kind of a funny personality, like a child (remembers the Tux logo…)
  • He has a very speial personality, something you don’t find everyday