Blogs

ezpublish login/logout redirection

Searching for a while, I found hidden variable on login forms called RedirectURI is used to send someone somewhere after login. There isn't such a variable that you can append to a logout, but apparently you can add an ini file variable

such as
LogoutRedirect=/user/login

(http://ez.no/doc/ez_publish/technical_manual/3_9/reference/configuration...)

You could then have it go to a page of your choosing, but by that time your session will have been unset, so its not terribly useful besides sending them to the home page.

django

I've noticed that more and more websites are being run powered by django. I ignored the ruby on rails revolution and did quite well with php. However, having worked on several large installs it seems as if php is often not up to the task. It seems woefully inefficient to have a web application (they aren't scripts anymore) without state, so everytime it needs to hit disk to load a session or the database to re-run hundreds of initialization queries each time. One can just throw more hardware are it, but perhaps there should be state.

ezPublish

It seems painstaking to find any kind of useful demos and howtos for ezpublish. I'm not entirely sure of why the community of developers around it don't post any information, but it certainly is an issue. It makes starting out as a developer quite tricky and a laborious process of trial and error instead of spending time coding.

Updating DYNDNS from linux box behind router

So a few of my clients have routers that don't talk to DYNDNS or if they do seem to be pretty rubbish at it. I wrote the following php script which relies on the dyndns client. it does some screen scraping.


$temp = file_get_contents("http://checkip.dyndns.org"); //get html with IP address

$pos = strpos($temp,"Address:") + 9; //find starting position

$pos2 = strpos($temp,"/body") - 1;

$ip = substr($temp,$pos,$pos2-$pos); //get IP address

system("/sbin/ifconfig eth2:1 $ip"); //set it to a virtual device

Using Mencoder to compress and shift formats

I googled a bit and found this article. I'm reproducing it here to keep the text in case it ever disappears from the internet, just because every few months or so I'm in need of a good overview of mencoder flags. This seems to have quite a few use cases. Here's the original: http://www.linuxforums.org/articles/linux-video-conversion-using-mencode...

and here's the text:

Casting a character column to integer on sort in postgres

One of my clients had a field that they entered session numbers into, but sometimes they had session 101a and 101b so it was a varchar field. However when sorting by it, 1001 would show up before 101 as postgres was using a character sorting algorithm.

This was the original SORT BY session_number ASC and I googled a bit and found that you can cast within postgres so now it works with SORT BY (session_number::text)::integer ASC.

It works well until it finds an entry which isn't an integer, then it complains. Will investigate further options.

Setting date & time on digital camera after screen failure

So my camera had an unfortunate incident with some ocean water which ruined the LCD screen. The camera is still working fine and taking pictures as good as ever, except I can't change any of the settings unless I have the sequence memorized. When I dried out the camera I removed all the batteries, including the clock battery. Bad move, now all my pictures are showing up as being taken in 1979... so not in order.

Add interactive messaging to your site

A colleague of mine found some javascript and php to add faceboook style chats to any website. I'm currently not interested in the messaging portion but would like an easy way polling of updates to a website. I think a bit of testing around with this code and one could create dynamically updating without hitting the refresh button.

Updating Web software: the forgotten upgrade

Today I spent several hours updating all the drupal installs on my system. Luckily they are all hosted from one drupal install, however updating each database separately is quite annoying and I can see why these things are often left unattended.

Backup Systems

It seems as if every small to medium company I encounter relies on some form of automated backups. I'm not sure how many horror stories in the media are necessary to convince people that the only workable backup solution is an automated one. Not only that, but I would say an internal and external (off site) backups would be ideal.