Blog:Memory Leak


Jump to: navigation, search

A memory leak is unnecessary memory consumption by a computer program. The most common manifestion is the failure to release unused memory that has been allocated. A memory leak occurs when the program either loses the ability to free the memory or simply neglects to free memory it no longer needs. (source: Wikipedia, The Free Encyclopedia.)



Many ways to lose your data

Some of the many ways you may lose your data. Just a reminder on the importance of backups.

→ continue reading...

Wikilog v1.1.0 released


Wikilog version 1.1.0 has been released today. This version and the following branch (1.1.x) target the MediaWiki 1.16 branch, which was released on July 28th. This release can also be used with MediaWiki 1.15.

Wikilog is the MediaWiki extension that powers this blog. Wikilog enhances MediaWiki with some common blogging features, making it a wiki-blog hybrid.

Textual tree representation

Text tree example.png

This is something I need every once in a while, and I have to spend a few minutes remembering the algorithm every time. This time I decided to make this note so that I'll have it here the next time I need it.

This is usually called an ASCII tree, but that name would be inappropriate to this one since I used Unicode characters. There are many other similar algorithms around, this one is the one I use.

→ continue reading...

Wikilog v1.0.0 released


The first stable version of Wikilog, 1.0.0, has been released today. Wikilog is the MediaWiki extension that runs this blog. Wikilog enhances MediaWiki with some common blogging features, making it a wiki-blog hybrid.

Simple KDE4 fan control widget


My motherboard comes equipped with a W83627EHF sensor chip, which is supported by Linux via the w83627ehf module. It was automatically detected and configured by lm-sensors. The chip has an adjustable PWM output that allows the user to control system fan speeds. The Linux kernel module exports these controls through pwm* files under /sys/class/hwmon/hwmon0/device/. Writing an integer in the 0-255 range to any of these files changes the PWM output of that fan, altering its rotation.

I usually don't bother with system fan speeds, but my current CPU fan produces a particularly annoying noise at ~3300 RPM and above. Sometimes I want to manually adjust it in order to reduce the noise.

I decided to create this widget for two reasons: to have a nice and easy way to adjust the CPU fan speed, without having to manually issue commands every time; and to have a quick look on how it is to develop Plasma widgets (Plasmoids), specially through its Python bindings.

→ continue reading...

From Fedora to Kubuntu

When KDE 4.0 was released, I quickly realized that it would be better to wait for a "stable" release. I don't have a lot of spare time to deal with my computer, so KDE 4.0 would be a problem to handle in my situation. I'm a long-time RedHat/Fedora user, since the old RedHat 5.2 back in 1998, and I was somewhat satisfied with it.

So, I had to stay with Fedora 8 for some time, since Fedora 9 and further were pushing for the newer "unstable" versions of KDE... until Fedora 8 stopped being supported and KDE 4.2 was released. So, I decided to try Fedora 11.

→ continue reading...

Understanding the Linux load average

I've seen many people (Computer Science majors) using Linux load average incorrectly when evaluating the performance of a Linux system or cluster. There are some misconceptions about what means and how are calculated the values reported by the /proc/loadavg pseudo-file. The most common misconception is that those values are percentages of how much the system is loaded. In this post, I'll try to summarize what these values actually mean, and how they should be used from a scientific point-of-view.

→ continue reading...

Another port knocking solution

Port knocking is a mechanism that allows sensitive services provided by a server to be kept hidden and protected by a firewall until a specific sequence of requests are made to some other selected ports. This sequence of requests is called knocking. Which ports and the order that they must be knocked are a secret shared only to those authorized to access that service externally. After a successful knocking, the firewall opens the sensitive service port to the knocking host for a short time, so that a connection can be established.

Although not infallible (it was never intended to be), port knocking is a good mechanism to conceal sensitive services running on a server, like, for example, secure shell (SSH). Many people conceal their SSH service by changing the port it listens for new connections to something other than the default (TCP/22). This provides very little additional security and it is not enough when used alone.

There are daemon/tool-based solutions for port knocking, like knockd and The Doorman, but they have some inherent problems:

  • They are a single point of failure of the system: if the daemon dies or fails to load for whatever reason, you are locked out.
  • Not all networks allow egress TCP or UDP packets to arbitrary ports: it is a good security practice to only allow outgoing packets to known service ports, which the SSH port is usually included, but the other ports used for port knocking aren't.
  • Knocking a sequence of ports in a short time is not very easy: you either need a tool for that (usually provided with the port knocking solution), or you have to make it work with the available tools (usually netcat or telnet) and some scripting.

There is this iptables-only solution, which fixes the first problem. It uses only iptables and so is controlled directly from the firewall; you have no extra daemon running, which is a good thing. I decided to improve on that solution.

→ continue reading...


I don't usually write about myself, but today is special and deserves an entry. I just got my Master's degree in Computer Science. From now on I'm a Master of Science, or M.Sc.

The abstract of my dissertation:

This work presents the project and implementation of the scheduling policy with process migration support JUMP. Process migration is an important tool that complements the initial placement performed by the scheduling policy in a distributed parallel environment, allowing for dynamic and more refined load balancing, resulting in better performance of the environment and shorter response time for distributed parallel applications. The new policy unifies initial placement and process migration in a single algorithm, enabling the sharing of decisions for the common goal of providing a better performance for CPU-bound applications in heterogeneous clusters. The policy is implemented over the dynamical and flexible environment AMIGO, adapted in order to support process migration. Performance evaluation showed that the new policy offers expressive gains in response times when compared to other two scheduling policies implemented in AMIGO in almost all scenarios, for different applications and different environment load situations.

My sincerest expression of gratitude to my supervisor Dr. Marcos José Santana, and to National Council of Scientific and Technological Development (CNPq).

Logitech G9 Laser Mouse

Logitech G9 Laser Mouse

I just got my hands on a new mouse, a Logitech G9 Laser Mouse. For sure, this is one of the best pieces of hardware I've seen in the last ten years, really worth its cost.

As usual, just plugging it on Linux and it is promptly recognized and enabled. The mouse appears to the system as a keyboard+mouse composite USB device. Probably the keyboard part is used for the macros and other functions (zoom in/out, etc) you may program in it.

But the mouse part is a little non-standard, and not all the buttons were generating the correct events. Xorg's default "mouse" driver had the horizontal scroll messed. Some Google searches showed that more people had problems with this mouse on Xorg and different, diverging configurations suggested:

I tried the "evdev" driver, it really did a better job getting all the buttons recognized, but unfortunately none of the suggestions correctly mapped the buttons to the correct events, so that I could tilt the wheel to scroll horizontally.

→ continue reading...

Quick-converting the encoding of filenames

Sometimes, people send me files (usually packaged in some container that is not Unicode-aware) with names in character encodings that differ from my system configuration, and I end up with broken filenames in my filesystem.

Some time ago I wrote a script, i18n-rename, to quickly convert the character encoding of a set of filenames. Since this may be useful for someone else, I'm releasing it to the public.

Documenting object-oriented C code with Doxygen

Doxygen 1.5.7, released Sep 28, 2008, implements a new useful feature of particular interest for people doing object-oriented programming in C or other languages that don't have native representation of such concept.

Object-oriented programming in C is not uncommon. It is usually done by promoting struct constructs to classes, and specific functions to methods. There are many different (but similar) ways to achieve this. Google provides plenty of links about object-oriented programming in C.

→ continue reading...

A summary about the DNS vulnerability

This is a summary of events around the recently discovered Domain Name System vulnerability. In short, one of the core Internet protocols have a serious design flaw. This flaw compromises the whole domain name system, the privacy and the security of all Internet users. There is no real solution ready to deploy today, but patches to mitigate the problem were released. It is important to check your system and take immediate action if you find that you are vulnerable.

Keep reading for more information.

→ continue reading...

Linux, KDE: Mapping functions to extra keys


My laptop (an HP/Compaq nx6110 notebook) has this extra non-standard special function key that is (normally) only available on Windows, through a special driver installed. Pressing it while running Linux does nothing but generate these messages on syslog:

kernel: atkbd.c: Unknown key pressed (translated set 2, code 0x89 on isa0060/serio0).
kernel: atkbd.c: Use 'setkeycodes e009 <keycode>' to make it known.
kernel: atkbd.c: Unknown key released (translated set 2, code 0x89 on isa0060/serio0).
kernel: atkbd.c: Use 'setkeycodes e009 <keycode>' to make it known.

No events are registered on X. I was bothered and decided to make it useful on Linux too.

→ continue reading...

Bridges and tunnels in Fedora

Tunnel Example.png

Fedora Linux supports setting bridges and tunnels through its startup network configuration scripts, even though the frontend (system-config-network) doesn't allow their creation or management.

Of course, it is possible to set bridges and tunnels by issuing the appropriate commands in /etc/rc.local, but this solution is not optimal since it bypasses the network scripts, making it harder to manage connections (i.e. no ifup and ifdown support). Keep reading to learn how to do it using Fedora's own network configuration scripts.

→ continue reading...