Setting the brightness in Awesome

Being able to change the luminosity of a screen is always something useful, to adjust it when there's more or less light, or even switching it off to keep a laptop processing. This usually works on it's own when we use an en­vi­ron­ment like KDE or Gnome, but it may not be like this if we don't use certain drivers or if we prefer more con­fig­urable en­vi­ron­ments (like awesome).

If we prefer to do it manually, we can do it through the command line in /sys/class/backlight/. In each devices directory there's a brightness file that sets the current brightness (and that accepts changes), and max_brightness that shows continue.

TensorFlow in Python3

TensorFlow is an Open Source library that Google has released earlier this month. It allows to, in a simple manner, arrange processing and training flows, with elements like neural networks, and even implement new operations over it's ar­chi­tec­ture (tutorial and examples).

This library is written in C++, but the ar­chi­tec­ture, the data to be managed and the operations are declared in Python. This is great, as it yields a great per­for­mance without having to deal with Seg­men­ta­tion Faults, but if you were expecting to use Python3 for this... you may have to wait a while, at this moment it's not supported [tensorflow GitHub issue #1], but it's continue.

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.

Working on a Debian repo

Update: It looks like M.A.R.S. is now on the official repo ^_^ , so it's useless to maintain this one.

After spending the last hours spewing commands without direction I was able to setup a Debian repo, packaging M.A.R.S. and uploading it, the idea is to make a com­pi­la­tion of libre games which aren't on the official repo (I'd try to send it there but I lack the constancy to mantain it).

The repo is set up on codigopar­al­l­e­ and the public key used to sign is the same as always, 0x453125AC

And seems a good time to stop for today...

ps: At this time it only supports amd64 and doesn't list directory entries, I'll polish it later. The con­fig­u­ra­tion would be this:

deb unstable/$(ARCH)/
deb-src unstable/source/

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.

Server-side-agentless CM? Check ansible

Some weeks ago I looked at some con­fig­u­ra­tion management tools like chef, puppet and salt, but I gave up when noticed that a server side agent was required.

Fast-forward to this saturday, at the hack­meet­ing there was a talk about ansible, a tool for this purpose written in python. I didn't attended the talk but today I looked the website

Ansible is a radically simple IT or­ches­tra­tion engine that makes your ap­pli­ca­tions and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your ap­pli­ca­tions— automate in a language that approaches plain English, using SSH, with no agents to install on remote systems.

That looks really, really good, I'm testing it now and works great, it may be what you where looking for :P.

Previous »