Recent blog entries for boto

SMART and bad block reallocation fun

I’ve spent last night trying to find out how to handle some bad blocks reported by smartd, on the hard disk of a old laptop. The Bad block HOWTO for smartmoontools has lots of useful information, but too many calculations to be done by hand. To ease on the task, I’ve written a script to help on the task. The script simply does the calculations described on the HOWTO and shows you the result.

This is a sample run:

# ./lba2fs.py /dev/sda 11475078  # SMART says LBA 11475078 is bad
lba2fs, by Eduardo Habkost <ehabkost@raisama.net>
If you want to know what to do with the output of this program, check:

http://smartmontools.sourceforge.net/badblockhowto.html

[/dev/sda sector 11475078]
Press Return to automatically probe, or enter command:
cmd>
I think I've found: partition table
Checking the partition list...
/dev/sda2 sector 11073453
[/dev/sda2 sector 11073453]
Press Return to automatically probe, or enter command:
cmd>
I think I've found: LVM volume
Checking the PE where the block is located
pe_start: 384 sectors
PE: 168
Checking on which LV the PE is located
Found PE range on map (LV)
Checking maps of LV...
/dev/VolGroup00/LogVol00 sector 11073069
[/dev/VolGroup00/LogVol00 sector 11073069]
Press Return to automatically probe, or enter command:
cmd>
I think I've found: ext3 filesystem
Checking ext2 fs block...
Block size: 4096
Block: 1384133
debugfs 1.41.4 (27-Jan-2009)

GOOD: ext2fs block 1384133 at /dev/VolGroup00/LogVol00, not in use

You can zero the block running the following command, but:
1) Don't do that if the device is in use (e.g. filesystem mounted)
2) *You will lose data* that is stored on the block. It looks like
   It is safe to do that on this block, but be careful. Are your
   backups up to date?  8)

  dd if=/dev/zero of=/dev/VolGroup00/LogVol00 bs=4096 count=1 seek=1384133

I recommend doing a read-test on the block first, to see if an I/O error
is returned. Use the 'read' command for that.

[ext2fs block 1384133 at /dev/VolGroup00/LogVol00, not in use]
Press Return to automatically probe, or enter command:
cmd>

As you can see above, fortunately on my case the bad block was unused on the ext2 filesystem, and I could safely write to it to force the drive to reallocate the bad sector, and the I/O errors are gone.

The script just try to read from the devices, with no code to write to them, so it should be always safe to run it. However, be very careful when using the numbers calculated by it to write to a disk sector. Always keep your backups up to date.

Syndicated 2009-03-22 20:01:20 from Eduardo Habkost / diary » In English

As merdas que a gente escreve

English readers: skip to the paragraph in engrish below. It’s the fun part. 8)

Ontem eu estava organizando o monte de tranqueira que tenho guardada nos armários. E achei o texto do meu “projeto final” do curso técnico de processamento de dados que fiz na ET-UFPR, durante o ensino médio.

O projeto final do curso da ET-UFPR era uma maneira dos alunos fazerem de conta que aprenderam a programar e a planejar um sistema de informação, e da escola manter os alunos (bastante) ocupados durante o último ano do curso. Não importa que você aprendeu a programar, que o programa que foi feito não funciona (e se compõe principalmente de telinhas bonitinhas feitas arrastando componentes no Delphi), nem que você não sabe pra que diabos vai usar a maior parte dos diagramas que botou na “monografia” do seu projeto final. O mais importante é que você teve muito trabalho para fazer o projeto.

(A maior prova de que o projeto era um grande faz-de-conta é o nome que encontrei na página da dedicatória. Sério: onde a minha equipe (incluindo eu) estava com a cabeça quando dedicou o trabalho ao MJB[1]?)

O trabalho tinha um “resumo”, em português, e um “abstract”, em inglês (não lembro se isso foi idéia da nossa equipe ou de algum professor fã de protocolos acadêmicos). O texto em inglês foi a coisa mais hilária que li recentemente. A equipe que fez o trabalho era composta de quatro pessoas, e eu não lembro quem foi que traduziu o texto para o inglês. Mas tenho certeza que todos os quatro revisaram a coisa e acharam que estava bom.

Para sua diversão, aqui estão as duas versões do texto, exatamente do jeito que encontrei. Em minha defesa, eu só posso dizer: eu tinha 16 anos na época.

Em português:

Resumo

Um zoológico é um local que disponibiliza aos visitantes a oportunidade de conhecer animais de várias partes do mundo, proporcionando simultaneamente lazer e conhecimento. Para que este objetivo seja alcançado, é necessário um trabalho de bastidores que envolve material humano (técnicos-administrativos com as mais diversas funções), controle da dieta e da saúde dos animais e orientação aos visitantes. Diante do grande volume de dados e informações necessárias para este controle, que deve ser feito de forma rápida e eficiente, os recursos da informática tornam-se ferramentas muito úteis. Assim, estamos desenvolvendo um aplicativo que tem como objetivo auxiliar os técnicos veterinários no gerenciamento de algumas informações relativas aos animais que ali estão alojados, como: alimentação, ocorrências veterinárias e alojamentos; e além disso, proporcionar aos visitantes, através de recursos audiovisuais (multimídia), uma forma interativa de obter informações gerais sobre os animais: localização no zoológico, origem, alimentação, peculiaridades, etc., bem como sua própria situação na área do parque. Estamos utilizando como ferramentas para o desenvolvimento do sistema a metodologia de análise orientada a objeto, UML, descrita por FURLAN (1998) e a linguagem de programação Borland Delphi, versão 4.0, utilizando SQL Server para o gerenciamento do banco de dados. O aplicativo será disponibilizado para utilização em rede, sob o sistema operacional Windows 95 ou superior. A implantação do sistema possibilitará uma redução no volume de papéis e no esforço necessário para o controle dos animais, melhor orientação e maior comodidade aos visitantes e também uma melhora significativa no processo de gestão do zoológico.


Em inglês:

(English readers: the piece of engrish below is an excerpt (typed exactly as-is) from the documentation of a “project” my team produced at a technical course during high school. It’s pure fun, so I am sharing it. In my defense, all I can say is: I was only 16.)

Abstract

A zoo is a place that gives to the visitor the opportunity to know animals of anywhere in the world, offer simultaneously leisure and knowing. To this purpose be reached, is necessary a lot of work of the tambours, that include human material (manage technician with several functions), the control of the alimentation and the healthy of the animals and orientation to the visitors. Because of the large volume of information necessary to this control, that has to be done fast and efficaciously, the resourses of technology became tools so useful. So, we are developing a system that has a purpose an auxiliary to veterinary technician in the management of some information relatives to the animals that are accommodated, how: alimentation, veterinary occurrence and accommodation; and beyond, offer to the visitants through multimedia, an interactive form to get general information about the animals: localization in the zoo, origin, alimentation, peculiarities, etc., his own situation in the area of the park. We are using UML, described by FURLAN (1998) as object-oriented analysis method. The programming language used was Borland Delphi, version 4.0, with SQL Server to the management of the Data Base. The system will be available to use in network, under the operation system Windows 95 or updated. The implantation of the system will allow a decrease of paper volume and work necessary to animals control, a better orientation and a bigger confort for the visitors and a signification improve in the management of the zoo.


[1] O professor orientador durante o projeto. Vou me abster de comentar sobre o que acho dele.

Syndicated 2008-10-20 02:08:33 from Eduardo Habkost / diary

Meme

Meme

From Rich Sharples:

  1. Take a picture of yourself right now.
  2. Don’t change your clothes, don’t fix your hair…just take a picture.
  3. Post that picture with NO editing.
  4. Post these instructions with your picture.

Via Rich Sharples:

  1. Tire uma fotos sua nesse exato momento.
  2. NÃO troque de roupa, NÃO arrume seu cabelo. Simplesmente tire uma foto.
  3. Poste essa foto, SEM editá-la.
  4. Poste estas instruções junto com a foto.

Syndicated 2008-10-02 17:20:35 from Eduardo Habkost / diary

4a7d3d609129a9296bf7ac0608c2097

Can somebody explain to me where this hex string comes from?

It has lots of matches on Google. Most of them are on blog comments. But they appear on valid comments, so I don’t think it is some marker string being used by spam bots.

Syndicated 2008-03-27 17:33:14 from Eduardo Habkost / diary

Getting a mailing-list archive URL from a Message-ID

It happens often to me: I am reading a mailing list on mutt and I want to send a pointer to the message to somebody.

I always wanted to be able to press a key on mutt, and a script would query mailing list archives and find a URL for the message on a mailing list archive. Today I have found this to be possible. Gmane has a “Message-Id” URL format tha allows you to do it. Just point to http://mid.gmane.org/<message-id> and it will redirect to the message on the archives, if it is present.

Now, getting a URL for a mailing list message is as simple as piping the message from mutt to this small script:

#!/bin/bash
mid="$(grep -m 1 -i ^Message-ID: | cut -d: -f2 | sed -e 's/^ *//')"
kfmclient openURL 'http://mid.gmane.org/'"$mid"

And this can be bound this to a keystroke under mutt by simply using something like this on .muttrc:

macro pager U "msg2url\n”

There are other mailing list archives with similar features. But they are more specific to some mailing lists, so they are not as comprehensive as Gmane. Some examples:

  • http://kerneltrap.org/mailarchive/message-id/<message-id> (for KernelTrap mailing list archives)
  • http://www.red-bean.com/threadfind (mostly Subversion-related mailing lists)

Syndicated 2007-10-09 15:50:55 from Eduardo Habkost / diary

Brazil insisting on Internet Censorship

After the first fiasco, the brazilian judiciary insists that Internet Censorship is a good thing.

I haven’t found any news articles about it in english yet, but you can read the news in portuguese (or an automated translation). A court ordered the major brazilian ISPs to block another site. Now the target is not a big site, but a tourism agency that got some attention from the brazilian media recently, in news related to sexual tourism in Brazil.

It seems that at least the ISP I am using right now (BrasilTelecom) haven’t implemented the block yet. But considering that on the YouTube blocking case they have done this immediately after receiving the court notification, I think it is just a matter of time until ISPs receive a notification and implement the new block.

This blocking was also ordered because of a “public image protection” lawsuit. Not by a celebrity in this case, but somebody whose picture was taken and published on the site. The sad part is that probably most brazilians will not care this time because it is a small site not targetted to brazilians, and then we have a legal precedent for further Internet blocks caused by stupid reasons.

Syndicated 2007-02-07 16:00:48 from Eduardo Habkost / diary

Google is Smart

This surprised me:

'mandrake' highlighted when searching for 'mandriva' on Google search

How Google knows that “mandriva” was formerly called “mandrake”, to be smart enough to highlight “mandrake” on the results as if I had also searched for “mandrake”?

I don’t think they have added this to a “synonyms table” manually. I believe this was somehow detected automatically. My question is: how the Google software could have detected this automatically?

Syndicated 2007-02-01 15:05:23 from Eduardo Habkost / diary

Internet Censorship caused by a judge that doesn’t know how to write

The conclusion of the Internet censorship story is that the judge that ordered the blocking of YouTube cancelled the order. In the document that cancels the previous blocking (in portuguese), he alleges that he never asked the complete blocking of the YouTube site, but only the videos showing Daniela Cicarelli. But this is not what was written on the order he sent to ISPs (in portuguese). The order doesn’t mention any specific video, and asks explicitly that ISPs implement filters to block packets from reaching the YouTube servers, or block packets coming from YouTube servers.

So, now we can say that this country is in another list: the list of countries where judges don’t know how to write.

Syndicated 2007-01-09 16:44:12 from Eduardo Habkost / diary

Brazilian ISP block on YouTube is really due to a court decision

According to brazilian media, the brazilian ISP Brasil Telecom officially confirmed that YouTube IP addresses are blocked on its backbone due to a court decision.

On my last post I’ve said that I was just waiting to see the explanation for the block, from Brasil Telecom. Now we can confirm that it is not just a screw up on their part, as commented on Boing Boing.

So we can confirm it: Brazil is now in the list of countries where the State uses mechanisms for Internet Censorship.

Fortunately, I haven’t seen any report of other ISPs implementing the same block, yet. So I see two possible ways this story will continue:

  • Other ISPs don’t implement the block. Brasil Telecom will not like to have the competitive disadvantage of not providing access to a popular site while other ISPs still provide it. Brasil Telecom, users, and other ISPs fight against the court sentence. We win.
  • Other ISPs implement a similar block. We become China. Censorship wins. We lose.

To be continued…

Syndicated 2007-01-08 19:22:06 from Eduardo Habkost / diary

Brazil experimenting Internet censorship mechanisms

Brazil is making some experiments that may show the viability of implement Internet censorship mechanisms country-wide. As already noticed by others, YouTube was ordered to shut down by a brazilian judge, some days ago.

It is asked on the linked post: “I’m not sure what the Brazilian court intends to do to enforce this ruling, since YouTube (and its parent company, Google) are based in the US. Will they take steps to try and block access within Brazil?”. The answer seems to be: yes.

There are reports (some info in portuguese) that at least a major ISP in brazil is blocking access to YouTube. As a reader comments on the post, “it is still possible that this is just some sort of screw up on their part” (I hope so). Or, as a a user report says, it may be just that the ISP is “taking advantage of the hype on the case of the model having sex fun on the beach to lower their backbone utilization by blocking one of the main bandwidth-consumer sites.”. I am curious to know how this story will end.

I really hope this will demonstrate that this kind of Internet censorship in Brazil isn’t viable. But unfortunately this shows that the Brazilian Kleptocratic State has some disposition to become China, and that in our country a celebrity’s public image is more important than people’s freedom and ability to easily communicate (not that the court decision really help to change her public image).

By the way, the video that originated all of this is available on Google Video. Don’t expect to see interesting scenes on it.

Syndicated 2007-01-07 10:57:43 from Eduardo Habkost / diary

17 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!