Guy Rutenberg

Keeping track of what I do

Improved FTP Backup for WordPress

with 3 comments

This script backups both the database and files of a WordPress blog into a remote FTP server (while keeping a local copy). It’s an update of my WordPress Backup to FTP script. The main changes are auto-detecting database settings and better support for caching plugins (specifically WP-Cache). The new version makes it easier to backup multiple WordPress blogs to the same FTP server.
Read the rest of this entry »

Written by Guy

February 28th, 2010 at 8:38 am

Posted in Bash, Projects, Wordpress

Tagged with , ,

“CC Yourself” and Spam

without comments

Every good web programmer will note that the following contact form markup is probably flawed

<form>
...
    <input type="hidden" name="to" value="support@example.com" />
...
</form>

as it is likely that if the value of the “to” field changes the message will be sent to the modified address. The problem with this kind of functionality is that it allows a malicious user to send emails from your mail server. More specifically, it can allow spammers to user your benign server t send their spam (and as a side effect you might be flagged as a spammer yourself).

As this case is pretty obvious one doesn’t see many real-life uses of it anymore (but careless programmers used it more often n the past until they learned better). However one can achieve similar goals (spam-wise) by utilizing a common feature in contact forms: the “CC yourself” checkbox.

Read the rest of this entry »

Written by Guy

February 9th, 2010 at 11:27 pm

Posted in Uncategorized

Tagged with ,

Using MusicBrainz when Ripping CDs in KDE

without comments

I guess this tip is Gentoo specific. By default KDE uses FreeDB for getting CD info when ripping CDs. If you want to use MusicBrainz native service (not via their FreeDB proxy), there are several steps you’ll need to take.
Read the rest of this entry »

Written by Guy

January 9th, 2010 at 10:37 am

Posted in Tips

Tagged with , ,

Disable Touchpad Tapping in Kubuntu

without comments

In Ubuntu (gnome) there is an easy graphical way to disable tapping on the touchpad. However, KDE lacks such thing. But lacking graphical configuration doesn’t mean this should be difficult. All you need is the gsynaptics package. The package provides a small utility called synclient. Now you can disable tapping by doing

 synclient TapButton1=0

To disable the tapping permanently you should use the following to run the command at the start of every KDE session.

echo "synclient TapButton1=0" > ~/.kde/env/disable-tapping.sh

Written by Guy

January 8th, 2010 at 11:13 pm

Posted in Tips

Tagged with , ,

Using Duplicity and Amazon S3 – Notes and Examples

without comments

Up until now I’ve been doing my backups to Amazon S3 using my s3backup script. While it’s simple and does what I needed at the time, I’ve decided to cut some of the costs by switching to incremental backups.
Read the rest of this entry »

Written by Guy

December 12th, 2009 at 12:00 pm

Posted in Tips

Tagged with , ,

Upgrading All QT Modules in Gentoo

without comments

Upgrading minor versions QT seems to be a hassle, as each version blocks the previous and because of inter-dependencies, Gentoo can’t understand by itself how to solve them. The solution is to tell it to specifically upgrade all installed modules.
Read the rest of this entry »

Written by Guy

November 21st, 2009 at 10:01 pm

Posted in Linux

Tagged with ,

NVidia driver fails to initialize after X restart

with 2 comments

This is mainly a note to myself. Sometimes when the X server is restart it complains that nvidia driver couldn’t be initialized and that no screens were found. This may be a result of a version mismatch between X11’s and the kernel’s nvidia module. The solution is to

modprobe -r nvidia

before restarting the X server.

Written by Guy

November 14th, 2009 at 5:19 pm

Posted in Linux

Tagged with

Blocking IP Range using UFW

without comments

Uncomplicated Firewall (ufw) is one of the greatest frontends to IPTables I’ve encountered. It is very simple to use and I just wish it was also available for Gentoo. Up until recently everything went smoothly for me and ufw, but we hit some rough waters when I’ve tried to block an IP range.

To block an ip or I’p range in ufw you should do

sudo ufw deny from 188.162.67.197/21

Read the rest of this entry »

Written by Guy

November 7th, 2009 at 9:19 pm

Posted in Linux, Tips

Tagged with ,

An Early Release of the New cssrtl.py-2.0

without comments

It has been three years since I’ve released the original version of cssrtl.py (and two since it’s re-release). The old version did a nice job, but experience gained during that time led me to write from scratch a new version. I’ve detailed more than a month ago, the basic principles and ideas that guided me to design a better tool to help adapting CSS files from left-to-right to right-to-left.

The guidelines weren’t just empty words, they were written while working on the Hebrew adaptation to the Fusion theme and in the same time writing a new proof-of-concept version of cssrtl.py. The original intent was to release a more mature version of that code when it will be completed. However, due to the apparent shortage of time in the present and foreseeable future, I can’t see myself complete the project any time soon. So following the “release early” mantra, I’ve decided to release the code as-is. As I said, the code is in working state, but not polished, so it may be of benefit but may contain bugs. If you find any bugs or have any suggestions, I would be glad to hear.
Read the rest of this entry »

Written by Guy

September 20th, 2009 at 1:00 pm

Posted in Projects, Python

Tagged with , , ,

Simple AI Engine for the Oware Game

without comments

Sometime ago I worked with a friend on building an Oware game. I was supposed to build the AI engine, and he was supposed to build the user interface to it. Unfortunately, while AI engine interface I designed and a simple alpha-beta pruning engine was implemented, the project was never completed.

Screenshot of game session

Screenshot of game session

Read the rest of this entry »

Written by Guy

August 19th, 2009 at 1:54 pm

Posted in C/C++, Projects

Tagged with ,