Making MySQLdumps more friendly

Some time ago I had to work with some MySQL database dumps generated by mysqldump(1), lacking a version control software (which for­tu­nate­ly hasn't been needed) more specific, the one used was git(7). Now, git allows to make diff across versions, but this (at least by default) is made line by line so mysqldumps get a lot of data changes even if only a row is the one changed to solve this issue this program was written sqlsplit.c.

The program isn't too polished, it has a main function that only opens the file and another which (with the help of two macro *_*) simulates something like a continue.

Writting an Erlang port

This quarter we had an subject with a an assignment to be developed in Erlang, a functional language which oriented to concurrent pro­gram­ming and in­ter­process com­mu­ni­ca­tion through message passing. The result is a crawler where each domain has an assigned “thread” which has to make the requests to the web server, plus another one to download the images and index them using pHash, the program is composed of more parts but now we'll center in this.

(By the way, the project has been developed on the open, the code is available at it's GitHub repository, EPC).

At the beggining each thread simply made a call httpc:request, which is the way that continue.

Editing files in place

Reading the rsync(1) manpages, the option --inplace doc­u­men­ta­tion alerts of:

In-use binaries cannot be updated (either the OS will prevent this from happening, or binaries that attempt to swap-in their data will misbehave or crash).

Some time ago I tried to write a program which would modify it's own binary to save data (without a specific motivation), but it resulted in errors when modifing it's binary while in use, also, it's possible (in POSIX systems) to delete files used in that moment. The read of the option above showed a viable path to do this, so here is the program which modifies it's own binary to save a number, continue.

« Next