
The third level in backup security and one of the most important is to be able to store backups in a place different than the production place, well known as Keep backups off-site. Currently taking advantage of free services like gmail, it´s much easier to fulfill this third level of backup security and to have all your backups available through an internet connection. Here I show a homemade script that does the following steps.
- Compress your web server, database and svn repository
- Encrypt compressed files with openssl
- Send those files to a gmail account
- Clean gmail account removing old backups
more »
Posted in Linux, Python | No Comments »

This is just a little tip for those who use python and work with COM automation components. If you are a windows user, and you want to write python scripts to interact with Adobe Photoshop, Microsoft Excel, Microsoft Visual Studio the best way to do so is using the this application’s COM componts. But most of the times finding documentation this COM components registered in your Windows is tricky and difficult. Using a simple tool that is automatically installed with the pythonwin module, you can get wrap python classes for all interfaces and constants exported by a registered COM component. This usually helps a lot to find non documented methods, and even to make your python script more legible and clean.
Posted in Python | No Comments »
I have to admit that I wasn´t very proud of my matplotlib code to represent the temperature values I was gathering with Arduino. It was pretty complex, and too slow. Meanwhile I´ve been facing several issues that requires data representation and searching for alternatives I came across a nice solution, flash charts. I found two projects, one open source,
Open Flash Charts, and another commercial, but with a free distribution,
FusionCharts
more »
Posted in Python | No Comments »

I´ve spent some time thinking how to backup the data I´m currently storing in my linux server. First of all, I faced the problem of coding the script to backup and then configuring the cron services to execute it daily. When all was working I had to decide where to put those backup files, because leaving them in the server hard disk wasn´t a solution. So I bought an USB hard disk and from time to time I move the backup files there. I was more or less happy with the solution. But some months ago I talk to a friend and co-worker who was starting to use a gmail account as a backup storage. I thought that was a great idea so I started to find a python library that helps me to send all my backups to my auxiliary gmail account, and I found it, libgmail .
more »
Posted in Python | No Comments »

At the beginning of this year I set out to take control of my expenses. To do so, I wanted to automate this annoying task as much as possible, to be aware of my expenses without spending too much time. I started gathering data from my bank using the Norma43 format, then adding this info to a database and so on. After all this, I needed to create reports, and I thought that OpenOffice spreadsheets could be a great place to store them.
To create your procedural spreadsheets you can use csv(coma separated value) files, but you loose the ability to set format configurations like font color, column width and so on. With the ooolib, you can use Python to to create procedural OpenOffice spreadsheets easily and without pain. It doesn´t support all the format options you have in Calc, but the main ones. Definitely enough for me.
Posted in Python | No Comments »

In Spain, all banks has an unified file format to supply statements of account, this format is known as Norma43. The first version of the format was released May 1982 and it’s quite simple to parse. Almost all bank’s web supplies Norma43 files with your account info. If you want to process this info, inserted in a database or whatever software treatment, this file can be very helpful. I’ve implemented a python class that parses this file format and fill in an array with all the registers in the file and its field values.
Posted in Python | No Comments »

Finally I rescued from backups the code of the MgtLife, a Python application I developed a year or two ago for Symbian. The main purpose of this application is to keep updated the life points of the two opponents of a Magic The Gathering match. This is what I call a freak combo, Magic + CellPhone + PyS60.
more »
Posted in Python, Symbian | No Comments »

After analyzing any measurement values I always ask myself the same question, is this data wrong or not?. To check if my temperature measurements were good enough I gathered in all the thermometers in my home and placed next to the Arduino+LM35. Then I confirmed that the LM35 was doing a good job, but that wasn´t enough, I needed to know if the measurement of the LM35 could be at least a naive model of the whole room temperature. To do so I started working with PyEphem and probed that the temperature data was correlated with the sun altitude.
more »
Posted in Python | No Comments »

Data is almost useless without a proper view. After storing the temperature data I need a way to plot this information so I can infer something. Let´s face the ‘artistic’ stage of the project.
more »
Posted in Python | 1 Comment »

What does Magic The Gathering (the card game) and Python in common? Just my first python project for my Nokia 6600. During the last year I’ve been playing Magic The Gathering with some friends. In this game you fight with spells and creatures represented by the cards against your opponent. You start with some life points and you loose the game when your life points decrease to 0. So you need a way to keep the state of your life points. Usually you use some kind of tokens such us, coins, little stones, etc… What about using a python program to keep this points and easly add or substract life points using the cellular arrows? That’s how MtgLife was born.
Posted in Python | No Comments »