29 Mar 2010I'm in the process of automating the backup of all the mysql databases of my clients' website. We never know what can happen, so having a backup of all this data is really really important.
MySQL data contains all the data added by the user, it means that unless you make regular backup of this data, you can't regenerate it.
I have multiple clients, with several websites each and an equivalent number of databases. I wanted to store a backup of all those on my local drive, to prevent any server crash problem.
I wanted a daily backup, and as my working station is on Windows XP I tried to find a simple software to do just that.
There is a little tool called mysqldump on linux that does just that : saving an entire database in a single file. Joined with some cron job and rotating the files it shouldn't be hard to implement.
But finding a software to do that on Windows is just terrible. I've been searching for them for more that 2 hours now and everything I find is horrible.
At first I found AutoBackup for Mysql but the software is written in something that even myself can't call English (and I know that my prose is not exactly Shakespeare). I had to click on some options to guess what it was supposed to do... I guess after some practice and once the tasks are scheduled it doesn't matter anymore but the trial version can't save more that 50 records per table and the price of the full version (~100$) is by far too expensive.
By continuing my quest, I ended up downloading this same software under different names.
Then I found DumpTimer and its brownish interface. It is also a great example of ergonomic errors : window too small forcing to scroll to reveal the options, nonsense message boxes popping, large amount of typo errors, limited choice of options.
But it does the job, in a very basic form, but it does it right. I could save my list of servers, check which databases and tables to save (well, all of them) and choose where to save them. There also was an option to copy them to another database, but I didn't tried that.
One of the main caveats was that it could only save the most recent backup, there was no way to save, say, the last 30 days.
25 Mar 2010It seems that Viddler changed something on their video API in the middle of January, and it broke utf8support.
All the videos I've uploaded to their service from October 2009 until January 10th 2010 are working correctly.
But for every video uploaded after that (in fact, from January 24th as far as I can tell), the description text gets corrupted. All the special characters (like é or €) gets replaced by their un-encoded counterparts (like é).
It happens either when using their API from a distant server or using their homemade simple uploader.
Even "worse", when retrieving the video details from their API the description field gets "htmlspecialchared" and I end up dealing with é
Anyway, I send them an email about that. I've had to contact Viddler support in the past and they are quite responsive, so I'm sure they will correct this in no time, seing how trivial it is (in fact, the title field is not affected by this bug).
Update 29th March : Viddler support filed a ticket for the issue.
25 Mar 2010I've been using SWFUploadfor quite a long time now. Put simply, it's a Flash/Javascript plugin allowing a file upload to be done without having to submit the page.
Basically it uses the streaming upload capacity of flash to fire javascript events to tell the developer the upload percentage, do some filesize and filetype checks, etc.
If you've ever seen an upload progress bar on any website, it most surely was done using SWFUpload.
Anyway, today I spotted a strange behavior in one of my pages, heavily using SWFUpload(more or less 20 upload fields). Using the Net panel of Firebug, I saw some strange GET requests being made to my website.
After digging into my code, I could isolate the problem. I was coming from SWFUploaditself. I even found record of a bug report mentionning it.
In a nutshell, SWFUpload always make a request to the url specified in the button_image_url parameter, even if you haven't specified one (in this case it made a request to your webroot).
I'm not using any image for my button, or should I say, I take care of that in CSS already, my SWFUpload button is just an invisible Flash element, positionned on top of my existing button.
I tried setting the value to null, falseor an empty string, but it would continue to do the request.
Anyway, I upgraded to the latest version (2.5.0 Beta 3), and it solves my problem. Now I'm just hoping that all the retro-compatibility will be kept.
18 Mar 2010I don't usually change MX resolving, but when I do, it always almost is using my registrar or host admin panel.
When I have to manually do it, (because the website is hosted on a dedicated server where I have to manually edit almost everything), I always waste a lot of time understanding where to find the configuration files.
Today I had to change the MX record of an existing website to use those of Google. The server hosting the website was also defined as nameserver, so I had to update the /var/named/domain.tld.hosts file (the file may not be in the same directory in your own server).
I remove the line relative to the MX records and added those instead
domain.tld. IN MX 10 ASPMX.L.GOOGLE.COM.
domain.tld. IN MX 20 ALT1.ASPMX.L.GOOGLE.COM.
domain.tld. IN MX 20 ALT2.ASPMX.L.GOOGLE.COM.
domain.tld. IN MX 30 ASPMX2.L.GOOGLE.COM.
domain.tld. IN MX 30 ASPMX3.L.GOOGLE.COM.
domain.tld. IN MX 30 ASPMX4.L.GOOGLE.COM.
domain.tld. IN MX 30 ASPMX5.L.GOOGLE.COM.
It worked well.
I also wanted to use a simple address for the webmail, like mail.domain.tld.
So I added the following line
mail.domain.tld IN CNAME ghs.google.com.
I also updated the serial at the start of the file and rebooted my server. I know there must be a less savage way that rebooting the server but I still haven't find it.
P.S : I used this google / DNS Stuff page to help me test my records all along the way
11 Mar 2010When writing my image plugin for tinyMCE today I came accross the mceRemoveNodecommand that one can use to alter the tinyMCE editor content.
It has to be used with editor.execCommand('mceRemoveNode', true/false, node).
I don't really get what the true/falseargument was about, setting either one or the other didn't change anything (that I could tell) in my case. The node argument is the DOM node you want to remove from the editor.
At first I thought that the command would allow me to remove a node from the editor area. I needed it in my plugin. But it was not exactly what it really does.
In fact it only removes the wrapping node, but keep the content intact. In other words if you have
<a href="http://www.domain.com/"><img src="http://www.domain.com/picture.jpg" /></a>
And you remove the <a> node using mceRemoveNode, you'll end up with
<img src="http://www.domain.com/picture.jpg" />
in place of your link.
I had to manually (well, with the great help of jQuery) remove the content of the link before removing it. I could have remove the node itself using jQuery but I thought that sticking to the tinyMCE methods would be a better approach, I don't want to mess all this stuff up, maybe "simply" removing html nodes like this could interfere with the textareavalue update, I don't know. And in doubt, I prefer to use the methods and command exposed by the API