Category Archives: Development

The poetic code

 

As well as the simple reading of a musical score is sufficient to an experienced musician to recognize the most velvety harmonic variations of an orchestral piece, so the apparent coldness of a fragment of program code can stimulate emotions of ecstatic contemplation in the developer.

Don’t be misled by the simplicity of the laconic definition of the code as a sequence of instructions to be given to a computer to solve a specific problem. Generally, a problem has multiple solutions, the most simple and fast to implement, the most economical from the point of view of machine cycles or memory, the elegant solution and the makeshift one.

However, there is always a “poetic” solution, the one that has a particular and unusual beauty and that is always generated by the inexhaustible forge of the human intuition….

[Read More…]

A WordPress Plugin to list posts in complex nested websites

 

List all posts by Authors, nested Categories and Titles is a WordPress Plugin I wrote to fix a menu issue I had during a complex website development. It has been included in the official WordPress Plugin repository. The Plugin is particularly suitable to all multi-nested categories and multi-authors websites handling a large number of posts and complex nested category layout (i.e.: academic papers, newpapers articles, etc). This plugin allows the user to place a shortcode into any page and get rid of a long and nested menu/submenu to show all site’s posts. A selector in the page will allow the reader to select grouping by Category/Author/Title. You can also manage to install a “tab” plugin (i.e.: Tabby Responsive Tabs) and arrange each group on its specific tab.

Output grouped by Category will look like:

CAT1
    post1                       AUTHOR
    SUBCAT1
        post2                   AUTHOR
        post3                   AUTHOR
        SUBCAT2
            post4               AUTHOR
            ...
            ...

while in the “Author” grouping mode, it is:

AUTHOR1
  post1               [CATEGORY]
  post2               [CATEGORY]

AUTHOR2
  post1               [CATEGORY]
  post2               [CATEGORY]
.....

The plugin installs a new menu “ACT List Shortcodes” in Admin->Tools. The tool is a helper to automatically generate the required shortcode. It will parse the options and display the string to be copied and pasted into any page.

The Plugin is holding a GPL2 license and it can be downloaded from its page on WP Plugins.

wordpress-logo

 

OpenStack: a .deb guy on (the) board

 

The elections for the new OpenStack board are coming closer
and this time the Open Source community has a great
opportunity of representation: Giuseppe Paternò is standing as a candidate for the board.

Although Giuseppe is considered by HP and Forrester Research
among the top talented consultants in the world,
Gippa (as he’s largely known in the industry) is still “one of us”,
a “nerd” that grew up with a keyboard on his hands.
As he’s one of the candidates of the OpenStack board,
Fabio Marzocca – wishing to know more – has interviewed him.

[FM] The hard question. You’re a techie. Why the hell are you running for the board?

[GP] This is indeed a good question ☺ It all started as a challenge from some clients and friends that are working in the OpenStack project. The truth is that the board and most of the management of the foundation are from vendors. I’m not questioning here if they do a good job or not, it is very likely that they tend to protect their own interests. In my opinion it lacks some “community spirit” that have fostered Linux development such as Debian and Ubuntu. That’s why I’m running for it, to bring the community where it should be.

[FM] Back to Debian and Ubuntu, could you tell us your story with Linux?

[GP] I discovered Linux in 1994, but only in 1996 things were serious. By the time I just finished high school and I applied for a job in a local Internet Service Provider. At 15 years I was well known in the local community as I was installing and maintaining several BBSes, so it wasn’t hard to get the job. I can say it was love at first sight. I started with Slackware (was the first distro), but I moved into redhat first and then debian. When I was working for the IBM Linux Technology Center, I was in charge of helping porting Linux to PowerPC and backporting LVM to make it similar to AIX. Sun was also a good playground as they acquired Cobalt, a hardware appliance based on debian. Then I shifted more towards Enterprise Linux adoption with 6 years in RedHat and then I went to Canonical. I was happy to go back to Debian and Ubuntu community, because I still believe that Ubuntu Developer Summits (UDS) were the real spirit of a Linux community.

[FM] Another hard question. We know you’re somehow involved in the “rebellion” of Devuan.org. What is your opinion about systemd?

[GP] Let me tell you that it’s not totally black/white and let’s see the two sides here. Something like systemd was indeed needed. Each distro has its own way of init’ing the system and for a package maintainer or commercial software maker, maintaining different init behaviour is insane. And as an init replacement it totally makes sense. However, IMHO systemd went too far away, incorporating into its code something that should not happen. A DHCP client into an init system, seriously? I doubt it was in the spirit of the Unix and Linux system…
However, in the real world of “pets vs cattle”, where application matters more than systems, having a systemd as it is, doesn’t change that much.

[FM] OpenStack was incubated in Ubuntu and the roots are quite clear. Is there something else that you would like to see from Debian and Ubuntu in OpenStack?

[GP] Stability, if I can name just one. Currently OpenStack is released every 6 months, which was probably the best choice to speed up the development. However, this is now becoming a weakness, as enterprise customers can’t upgrade their critical infrastructures every 6 months. Traditionally Debian is “maniacally” focused on given a bullet-proof distribution, this is something that in my opinion is missing from OpenStack.

[FM] Gippa, tell us just 2 or 3 topics you will bring to action in case of election

[GP] I’d like to introduce an OpenStack “LTS” process, following the Ubuntu approach: while releasing every 6 months is fair enough for development and testing environments, having a stable release every 2-3 years can give enterprise customers the peace of mind they need while running production environments.
I’d also love to see a consolidation of the core (Nova/Neutron/Cinder/Swift): vendors and developers are introducing new features and projects while I’d love to see –for example- a more stable and scalable Neutron and a more stable connection to Oslo (in particular rabbitmq).
In general, I would encourage more attention to who is actually deploying, integrating and using OpenStack every day. I would also try to foster the ecosystem of ISVs in order to release and certify their software for OpenStack. And – last but not least- to see interoperation between “regional” datacenters: I dream of a world where companies in a given territory can “work together”, and this is only possible through standards. I hope that OpenStack can represent this standard.

[FM] When are the elections and how can we vote?

[GP] Individual Member Director elections for the 2016 Board will be held online from Monday January 11, 2016 to Friday January 15, 2016. More informations on the website.

LADI Tools: first stable release is out!

During the last month I worked as upstream maintainer of LADI Tools and now I’m happy to introduce the first stable release! So, to answer the usual question “What’s new?”, here is a short description of the changes introduced (taken from the NEWS file included in the release tarball):

Laditools 1.0 «Lady “O”»

Apart from wladi and g15ladi, most of ladi* tools have been renamed:

  • ladicontrol -> ladi-control-center
  • ladilog -> ladi-system-log
  • laditray -> ladi-system-tray

Moreover, a new component has joined the LADI Tools suite: ladi-player. LADI Player is a convenient, graphical VLC-style application providing an all-in-one control interface to start, stop and monitor JACK as well as the session handler. It also provides basic controls for managing studios.

Goodbye PyGTK!

All the code was ported to GTK+ 3 and the new GObject Introspection mechanism.

Code refactoring and cleanup

The code has been reorganized in order to allow the use of Python objects by 3rd party applications.

To start writing code using the classes provided by laditools, simply do the following:

from laditools import *

Two-in-one solution for LADI System Tray

Formerly laditray was an implementation of GtkStatusIcon to put a nice right-clickable icon into the system tray to allow users access JACK controls easy way. It’s been mostly rewritten and now it shows an AppIndicator icon (if the library is available), or fall back to the Freedesktop.org’s old-fashioned System Tray Protocol Spec-compliant icon.

Project’s new homepage

The project’s homepage is now hosted by Launchpad.net, the code is hosted by repo.or.cz and it’s available here for browsing.
Please use the following links to contact the development team:

New up-to-date packages will hit both Debian and Ubuntu soon!

Nautilus Pastebin, how to send your files to a “pastebin” with one mouse click

I am very fond of those websites that allow users to upload files for a public viewing (called pastebin), usually I upload logs, links and other text files with pastebinit, a simple command-line tool, already available in Debian’s and Ubuntu’s archives, and I thought:

“Why don’t find a not-CLI solution to make it in a more fast and comfortable way?”

So I decided to write nautilus-pastebin, an extension for the GNOME file manager, which allows users to send files just a right-click away.

How does it work?

Simply: right-click on a file, select «Pastebin» and, if the Internet connection is active, after few seconds you will see a bubble like that one in this screenshot:

The extension doesn’t only show that notification, it also retrieves the MIME type in order to try to adjust the syntax highlighting parameter according to the configuration of the selected pastebin and finally copies the paste URL to the clipboard, allowing you to paste it in a browser tab, IRC channel or wherever you want.

The global configuration file is located into /etc path, but if you want to select another pastebin to use you may do it by creating a file like the following one:

[generals]
pastebin = $GLOBAL_CONFIGFILE_SECTION

The file must be named as nautilus-pastebin.conf and saved under ~/.config/nautilus-pastebin/.

If problems occured during the past operation, you may see a message like the following:

Where can I download it? And how can install it?

You can find all the information that you need by opening the projects page, for the installation, after uncompressing the tarball, you can:

  1. Use the setup.py script.
  2. Copy:
    1. scripts/nautilus-pastebin.py to /usr/lib/nautilus/extensions-2.0/python/
    2. data/nautilus-pastebin.conf to /etc/ or in ~/.config/nautilus-pastebin/
    3. data/nautilus-pastebin.png to /usr/share/pixmaps/

After the installation, you may need to restart Nautilus:

killall nautilus

Some pastebins of the preconfigured ones don’t work well and I need some time to improve and extend the support for other websites.

If you wanted to contribute to the development by sending me patches, configurations or suggestions I would be very happy!

Links:

New project: Installation Report Generator

That’s a screenshot:

This application, written in Python + GTK, collect informations about user’s hardware and software configuration, then compile an installation report according with the notebook page template of Ubuntu-it’s wiki.

For installation instructions and other informations about the project, please read this.

Realtek’s modules, new version has been released

If you read my previous article about r8169 module but it wasn’t the best solution for your Realtek ethernet adapter, now it’s the time to be happy! 😀

Realtek has released new version of r81* modules and now we’ll proceed to compile and install the right module we need, but please note that I have a RTL8101E PCI Express Fast Ethernet controller, so I tested this procedure on Ubuntu 8.04 «Hardy Heron» only with r8101 module.

Continue reading

How to compile r8168 and r8101 modules for Realtek ethernet adapters

r8169 module has a lot of bugs and it doesn’t work well with a large number of Realtek’s adapters, so, a few days ago, I posted a patch for the Realtek r8101 module, which supports kernel 2.6.23 but not the 2.6.24, newest kernel in Ubuntu 8.04 «Hardy Heron».

This howto could be a solution for a large number of ethernet adapters issues.

The first step is downloading the right driver (r8101 or r8168) for the adapter:

  • r8168 supports RTL8111B, RTL8168B, RTL8111, RTL8168 and RTL8111C;
  • r8102 supports RTL8100E, RTL8101E and RTL8102E-GR.

Continue reading