Aug 13

Makefile Macro for Testing External Tools

Quick & Dirty macro for testing the existence of external tools within a Makefile.

If this is reused correctly, one can avoid repeating test and set code for each tool required by a build-system.

The first argument is the variable used to store the tool path and the second argument is the name of the executable. The usage of which(1) presumes a reasonable PATH set by the user.

Sep 12

Finding the root device on linux

This is an example on how to find which device corresponds to your root filesystem on linux. This code was inspired by Michael Opdenacker post and related questions on StackOverflow.

The output will mark the root device partition with an asterisk.

This code has the advantage of not touching all the entries at /dev as done by rdev(8) nor recursing the files under /sys/block to find the exact device, which would be a bit more complex than parsing /proc/partitions.

Aug 12

Quick Recipe to Enable clang_complete on Vim

It’s been a long time since my friend Thiago wisely taunted me to start using clang on vim scripts (and on everywhere else too). I finally made some time to take a look on it, mostly because of this excellent rant on the subject.

The core of the problem is that OmniCppComplete isn’t a compiler and you can’t expect something that isn’t a compiler to fully understand code. — Guy Rutenberg

So, here comes my quick recipe to get it running on vim7.3+ with python support. I assume you already have your vim setup under revision control and use pathogen to group multiple bundles (these requirements are so lame that I refuse to spend any time to justify them ;-) ).

  1. install clang and partners
  2. remove omnicppcomplete bundle as in this answer
  3. create new bundle
  4. fine tune clang_complete settings
  5. profits ;-)

Done! C/C++ code completion at the tip of your fingers.

Just as disclaimer, there are still some rough edges on the clang_complete script, e.g.

  1. the preview window is not informative at all (better to disable with :set completeopt-=preview)
  2. you need to manually reload source files after updating .clang_complete files (just a problem on initial setups)

However, these do not spoil the overall experience at all. The next step will be to install Ubuntu 12.04 for libclang-dev usage (much faster than using clang command).

Aug 11

Using Textile+Trac to Manage Backlogs

After two and a half days discussing features, estimating them as a team and preparing a decent backlog, it was time to decide how to publish it. The idea of e-mailing a spreadsheet around and trying to figure out what has been modified terrrorized me. I’d like to have it an a central place where everybody could edit it and the (properly versioned) changes would be immediately available.

Whilst Google Docs could have been a nice alternative, it’d take me some time (maybe forever) to convince the managerial ranks to endorse it. Time to look for an answer closer to our company’s chest, like some internal system for managing issues related to a project, with a coupled VCS, user-based access and… Oh, wait! We already had Trac-Wiki1 set on our project!

With an embedded VCS enabled on the wiki, the only missing feature was being capable of properly rendering backlog tables on it. The built-in wiki syntax wasn’t enough to create a functional table, however it had a WikiProcessor2 extension mechanism which let me use other markups. As maintaining the backlog in pure HTML would be a pain, the alternative was to experiment a very flexible markup called Textile3.

After researching a bit of textile syntax4 and trying some examples, the following snippet plus a tweak at the theme style sheet rendered something near to a backlog.

SW01Feature 1m
(acceptance criteria 1)
SW02Feature 2n
(acceptance criteria 2)

The acceptance criteria on a separate row was kind of lame, so lets try to join it with the story name.

SW01Feature 1 (acceptance criteria 1)m
SW02Feature 2 (acceptance criteria 2)n

Much better! Now, what about appending dependencies to each story? Even better, why not referencing them as links to the story itself?

SW01Feature 1 (acceptance criteria 1)m 
SW02Feature 2 (acceptance criteria 2)n 
SW03Feature 3 (acceptance criteria 3)oSW01
SW04Feature 4 (acceptance criteria 4)p 
SW05Feature 5 (acceptance criteria 5)qSW01, SW02
SW06Feature 6 (acceptance criteria 6)r 

The   hack, used to prevent column spanning, may not be required in Trac as it is in my wordpress processor.

To finish a fancy and useful backlog we can add two classes to visualize the separation of stories per sprint. Those without a background color are still in the project’s pipeline.

SW01Feature 1 (acceptance criteria 1)m 
SW02Feature 2 (acceptance criteria 2)n 
SW03Feature 3 (acceptance criteria 3)oSW01
SW04Feature 4 (acceptance criteria 4)p 
SW05Feature 5 (acceptance criteria 5)qSW01, SW02
SW06Feature 6 (acceptance criteria 6)r 

With this template and relatively simple syntax, it seems easier to create, delete and move stories around. Modifications can be figured out at Trac’s page history and things get associated by the hyperlinks. Good bye, nasty spreadsheets! ;-)

Other advantage is that if you don’t use Trac for your projects, the only thing you need is a textile processor to get it done. You may auto-generate it from build-scripts, use another bug-tracker or integrate into WordPress (as I did it here).

A downside in this alternative is the need to specify custom CSS rules outside of textile content. I had to hack it into WordPress current theme’s style sheet and into Trac’s too. Look at the complete excerpt below.


1 Trac Wiki webpage

2 Wiki Processors

3 Textile homepage

4 Hobix Textile Reference

UPDATE: better colors and avoid selecting spans after the first one.

Feb 11

Classificados Tocantins

Eu e minha esposa estamos nos preparando para migrar de Manaus, portanto resolvemos nos desfazer de alguns bens que não iremos levar.

São todos itens adquiridos desde 2007, com estado de conservação razoável. Estamos colocando as fotos aos poucos pra agilizar, mas quem quiser dar uma olhada, por favor, entre em contato (pode ser pelos comentários aqui no blog mesmo ou pelo meu celular, caso me conheça).

Detalhe: os itens mais essenciais, como geladeira e fogão, só poderemos entregar a partir do dia 12/03/11, que é quando devemos fazer a mudança para o novo “lar de transição“.


Fogão Mueller 4 bocas 150.00
Máquina lava-roupas Electrolux 8kg 550.00
Liquidificador Mondial Ultramix 3 com coador 45.00
Geladeira Electrolux Frost Free DF37 900.00
Rack Fruteira Cozinha 110.00
Bebedouro Refrigerador Mallory 180.00
Micro-ondas Electrolux 150.00
Armário Alumínio Colormaq Cozinha 3 portas 320.00
Grill George Foremann médio com estufa para pão 100.00


Rack grande 290.00
Rack pequeno 90.00
Sofá Branco 3 lugares 400.00
Mesa com banquetas 150.00
Mesa retangular dobrável 110.00
Mesa p/ computador 50.00
TV Sony LCD Bravia 32pol 850.00
TV Philips tubo 21pol 150.00
Câmera Digital Kodac 4MegaPixel C433 + 512MB 150.00
DVD player philips DVP320 70.00
Caixa Som + Subwoofer 2.1 Clone com entrada celular 180.00
Ventilador Seville Classic torre giratória 165.00
Bicicleta Caloi 18 marchas T-Type com acessórios 700.00


Ar condicionado Consul 7500 300.00
Ar condicionado Eletrolux 7500 c/ controle 420.00
Ferro Walita 40.00
Tábua de Passar 40.00
Maca para estética branca 300.00
Vitrine vidro 6 módulos 250.00
Cabideiro/Arara 120.00
Sapateira 2 portas 4 estantes 120.00
Colchão Solteiro Probel 12cm 50.00
Apoio Triângulo 60.00

Jan 11

Hiding that horrible tabline in Vim

Long time no post in here, sorry.

Since I’ve had the chance to review Kim Schulz’s Hacking Vim 7.2 ebook1 and a friend of mine started using vim as his main development tool, digging into Vim’s configurations and flavours has become somewhat even more pleasant.

In an attempt to improve my performance when editing various files, I’m trying to use tabpages instead of only several windows. It’s been working as some kind of context stack for me, as there can be one tabpage (probably with fewer windows) for modifying files from a project and another tabpage for a different but related one (or a non-related task in the same project). Plus, using more tabpages and less windows can save precious screen space.

But what to do about that odious tabline which, besides hurting my sense of aesthetics, eats a whole line of the screen? Thankfully to the Vim’s extremely flexible nature, it didn’t take long to find an answer. It came in form of disabling the tabline entirely and putting its only usable information into the statusline. Used a bit of scripting to overcome the only corner case I could think of and took the chance to try my rusty skills on python + vim bindings. Pretty much everything someone will need to put both domains together is in this little example (besides the vim module complete API, easily accessible by issuing :h python).

There you see how to pass arguments into python methods and how to feed values back from it to the vim environment. Eventually I’ll publish my entire .vimrc with comments so everyone can rant about how theirs way is better ;-)

[1] as I’ve lost my notebook due to a robbery at the technical assistance, my review annotations were lost too. I’ll need to re-review the book to get something published about it then.

May 10

gource: OpenGL-based 3D visualisation tool for source control repositories

Too much fun the tool I’ve came to know through my friend Adenilson’s blog. In a glance one can explore effort put into a project in a way much better than any other command-line or graphical application known.

The only boring thing is to use it in my machine, a hp pavilion dv4-2167sb, which, AFAIK, still lacks a good graphical acceleration support.

I’ve made a very basic debian package (using checkinstall) for people too lazy to compile/install by themselves.

Enjoy it and have fun!

Mar 10

Vendo Minha Moto

Sorry, available only in pt_BR.

Num esforço de desapego, decidi passar pra frente minha fiel companheira… de estrada. É isso, pra quem se acostumou a me ver junto da minha máquina atravessando o Brasil e registrando no site do RockPesado, saiba que não faço isso por desgosto, mas simplesmente por adequação, já que não pretendo trazê-la novamente para Manaus-AM para negar-lhe os prazeres que uma moto estradeira merece (asfalto bom, várias opções de destino, peças a pronta entrega, enfim, tudo que alguém morando no Sul ou Sudeste tem de sobra).

Minha moto é uma Honda Shadow e foi apelidada de Uákti, em homenagem a lenda do belo e encantador índio que, após ressucitar de uma morte com várias flechadas, emitia um som de flauta quando o vento transpassava seu corpo, atraindo ainda mais as mulheres das tribos e provocando mais inveja dos homens. Abaixo uma breve ficha técnica:

Marca: Honda Shadow VT600C Ano: 2002 Cor: cinza Quilometragem: 63.000 km Últimas trocas: - Corrente, coroa e pinhão (CoCoPi): 55.000 km - Pneu traseiro: ~55.000 km - Pneu dianteiro: ~57.000 km - Filtro de ar: ~60.000 km

Como toda moto custom que se preze, traz vários acessórios estendendo suas configurações originais.

  • Sissy-bar com bagageiro
  • Banco remodelado (feito pelo lendário Peninha, artesão de estofamentos de Curitiba-PR)
  • Comando avançado
  • Plataforma para os pés do piloto e carona
  • Protetor de cárter (peito de aço)
  • Protetor do reservatório de água (ponto fraco das Shadow)
  • Mata-cachorro
  • Faróis de milha com lanterna
  • Alforges laterais (surrados, mas ainda bem usáveis)
  • e mais alguns detalhes mais estéticos que funcionais (saia reduzida na placa traseira, tampão cromado do retificador, suporte extra na grade da refrigeração, etc)

Pela tabela FIPE ela custaria até R$16 mil reais, mas estou disposto a vendê-la por um preço menor que este.

E tem mais, quem ligar agora leva também um conjunto de câmeras (dianteira e traseira) dos pneus de brinde! Totalmente grátis! – momento polishop :-D

Pra quem estiver interessado, ela se encontra em Curitiba na casa do meu pai. Pra apreciação, mande-me um e-mail que arranjo a visita.

Essa moto é guerreira, já me levou em segurança por todo o litoral do Brasil e do Uruguai, sobreviveu a hostilidade da polícia Argentina e cortou tranquilamente todo o Centro-Oeste brasileiro, inclusive passando pela capital federal. Portanto não estranhe se ela reclamar quando tirá-la de casa pra andar menos de 200km!

Oct 09


Sorry, this entry is only available in Português Brasil.

Jun 09

Qt/openBossa Challenge

Nice opportunity to win a Nokia N810 tablet at the FISL. (Free translation from pt_BR)

Do you have a good idea? Do you know the Qt library? Would you like to be awarded for that?

The INdT (Nokia Technology Institute), nowadays one of the main development excellence centers in Brazil, promotes the first Qt/openBossa challenge.

We look for developers capable of putting your ideas into practice and build Qt applications designed to Nokia’s mobile devices. Participants will create innovations which will be evaluated and awarded during the 10th International Free Software Forum (FISL).

More at http://openbossa.org/fisl/index.html.