Category: Utilities

Creating Blog Spam Alerts

Many of the various sites I maintain have comment sections. Some have Forum software (typically Kunena), some allow comments on articles, some on images. All of these site have in common that if the configuration is not perfectly right, you end up with tons of spam. And by “tons,” I mean several gigabytes of uploads a month.

I am slowly getting the configuration down, but every software update, every new installation is another potential trap. Then I will look at the stats and realize there is a sudden surge of uploads from a particular location (so far, Russia and Ukraine have been particularly prolific). I will look at the comments, and they will typically be in English and try to sell (for whatever reason) fashion articles.

I assume, from referrer traffic, that this is a ploy to increase the search engine ranking of sites that sell counterfeit wares. If I have a link to a Guggi handbag (popular with spammers!), and I am a “good” site, then Google et al. will rank the link higher.

So far, I’ve been going for a very low-level approach: I look for IP addresses that generate “too much” traffic, block them, and look at the database tables that hold comment spam. Then I remove the offending comments manually.

(more…)

SVNFS: a Versioned File System

Working with version control systems can be a pain in the butt. I notice that most frequently when I do a find in an SVN directory and find all the administrative files that go with it. It’s factors more files in there than in the actual directory.

At the same time, there are times when you would want every access to a file recorded, so as to be able to undo things. Restore the status as of last Monday, or see the difference in that file that just got changed a minute ago.

Versioned file systems have been around for a long while. On Linux, apparently, the default is copyfs – which also apparently hasn’t seen much of an update in a long while. 

Here I used a different approach than that used by most. Instead of creating a file system that does its own versioning, I used an existing versioning tool, subversion, and made its use transparent. The advantage is that this file system doesn’t require you to learn a new tool, if you know subversion; if you don’t know or care about versioning, you don’t have to worry, either: this file system will be perfectly transparent to you.

(more…)

Clocky – a Tiny Title Bar Clock in Linux

clickyI am a compulsive screen maximizer. Start menu bars are set to auto-vanish on my screen, and the app rules the day. If you think I ever see my desktop, I have to disappoint you. Plasma widgets are useless on my computer, and frankly I don’t understand how anyone ends up having enough screen real estate to see the background picture they chose, unless there is a sudden crash of an application.

That leaves no room for a clock to be visible on my screen. A clock is one of those things you really need, once in a while, but unless it’s “once in a while,” it’s perfectly pointless.

Like the title bar on windows. You got the app icon, the title, and the close/maximize area, but otherwise it’s a waste of space. 

(more…)

Fillable PDF Forms For Free

You know when you get a form to fill out, but you need to print it and fill out by hand (or worse, try to fill it with your printer). Wouldn’t you rather be able to generate a PDF form out of it and then fill it out on your computer? Even better, have the form filled out automatically (as far as possible) with your usual data?

Well, I decided that’s something I wanted to do. In this particular case, I gave cash to two friends and wanted them to sign an IOU note. I found a PDF form online, but it required me to fill out their and my names twice and I balked at the duplication. (You can find the form by searching for “free iou form template”.)

The tools you will need to use (at this point) are commonly available for free. They are all open source tools, so there is a good chance they will be available years from now. In particular, we’ll need Scribus, a desktop publishing tool, pdftk, a PDF manipulation utility, and a few extra scripts and utilities.

(more…)

Blocked IP Addresses

This is an ongoing post, in which I record the IP addresses I had to ban on this server because of serious abuse/spam. I am posting this mostly so that I have a backup in case I reboot the server – but I sense that more people will find this list useful.

The following is the output of iptables -L -n on this server. Updates as required. Each IP address in this list has submitted more than 1000 requests for comments in RSGallery within a single day. The IP addresses and the servers behind them may be perfectly innocent, but in each case, the ban resulted in a sudden drop of comments. Also note that the comment feature has been disabled on this blog.

Chain INPUT (policy ACCEPT)
target     prot opt source               destination        
DROP       all  --  77.93.2.81           0.0.0.0/0          
DROP       all  --  31.184.238.13        0.0.0.0/0          
DROP       all  --  91.207.4.190         0.0.0.0/0          
DROP       all  --  94.181.0.0/16        0.0.0.0/0          
DROP       all  --  188.143.232.125      0.0.0.0/0          
DROP       all  --  31.184.238.21        0.0.0.0/0

Linux and the Polar F6 Heart Rate Monitor (2)

In the first post in the matter, I introduced you to a quick way of getting your Polar data into a Linux computer. I found that the transfer of data using sound is a nifty way of doing things, and the utilities written work pretty well.

There is one thing, though, that totally annoyed me about the process of transferring data: once you get the FRD files out of the watch, you have to manually add each exercise into SportsTracker – which is a tedious task at best, especially because it’s obvious SportsTracker is meant to track distances more than anything else. I mean, after all it was born as a way to track cycling and running workouts.

The oddest thing is that the FRD files are binary, while the final output of SportsTracker is XML. It was just a matter of looking at the file format and figuring out how to write the corresponding XML, which I did in the following.

(more…)

hugin

It's been a while I stopped using hugin, an open source panorama stitching tool, because it crashed all the time on me and it was unclear how to work with it.

I just downloaded the latest release (an ominous 0.6.1), and they somehow got it to work just fine! I am impressed! Download it from here

(more…)

Making a GIF/PNG Transparent In the Gimp

I have to search on the Internet for the solution to this problem every time I need to make the background of a GIF disappear, since it’s quite a strange process. So here is the short recipe:

  1. After the image is loaded, you need to add an Alpha channel. Go to Right Mouse -> Layer -> Transparency -> Add Alpha Channel. Nothing wil seem to have happened
  2. Perform any kind of selection on the image
  3. Hit Ctrl-K, or Right Mouse -> Edit -> Clear
  4. Continue until the checkered background fills the area you want transparent. Hint: if you want to get rid of single pixels, just enlarge the image and use the rectangle selector
  5. Save in a format that supports transparency, like GIF or PNG

That’s it!
(more…)

Migrating a Mail Archive from Mbox to IMAP

It’s been several years that I store all my email in Kmail. It used to be Outlook back in 2000, but I soon got fed up and converted to a Linux box where the .pst format was quite useless. I used a nifty utility to do the conversion on a Windows box, and everything worked just fine.

Now it’s time to move again. This server has a new IMAP implementation that polls my POP3 provider every minute, performs filtering, then allows me to connect from anywhere. That’s very usable, especially considering that I always run the email client at home and it would be quite annoying not to be able to read home email during the day.

Problem: None of the current email clients know how to move a repository to IMAP. Oddly enough, Outlook can do it no problem, while the open source world entirely ignores the problem. That’s quite silly, since a conversion utility is quite easy to write.

(more…)

Configuring Fetchmail -> Postfix -> Cyrus -> IMAP

A nightmare over several days. I had set my mind that a local store was no good, because I needed to be able to access my email from outside the apartment, and decided that IMAP would be the way to go.

Technically, what I needed to do was to take the mail I got from my outside provider and download it to my server (this one). Then I needed to pass that email to an IMAP server, finally to get to it from the outside world. This seems stupid at first, but I run a dozen filters on my email, so that it makes very little sense for me to access the email directly on my ISP’s site.

(more…)