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