Missing dashboard css and the perils of smart quotes

This is the tale of a mystery and intrigue about the disappearance of the css from a blogs dashboard and how we hunted it down and fetched it back.

Thord Daniel Hedengren, one of the writers for Blog Herald, put out a plea for help on twitter and was pointed in my direction.

He was faced with a WordPress dashboard which looked like this and wasn’t much use:

WordPress 2.8.4 dashboard without all the styling

WordPress 2.8.4 dashboard without all the styling

This evening I hooked up with Thord and with the help of his server administrator we tracked down the issue and thought it a good idea to spread the message to help any one else out there who has a similar issue in the future.

I started off by looking at the headers returned by the php file which concatenates all the CSS files together and noticed something strange:

HTTP/1.1 200 OK
Server: nginx/0.7.62
Date: Tue, 29 Sep 2009 19:34:47 GMT
Content-Type: text/css;charset=“utf-8″
Connection: keep-alive
X-Powered-By: PHP/5.3.0
Expires: Wed, 29 Sep 2010 19:34:47 GMT
Cache-Control: public, max-age=31536000
Vary: Accept-Encoding

As you can see here the Content-Type header looks a little strange, it has a charset specified but the value being returned is not a valid charset and it looks like this is probably why Firefox is refusing to apply this css file to the page.

This was starting to look like a server configuration issue so we got in contact with the server admin and we tracked down the errant configuration to the php.ini file.

Within the php.ini file you can set a default charset to be used if one has not already been specified for the request this had erroneously been set in the file with some smart quotes rather than normal quotes and so php was outputting the smart quotes as well as the charset name into the HTTP header.

Now the headers look like this and Firefox is happy to display a fully styled WordPress dashboard:


HTTP/1.1 200 OK
Server: nginx/0.7.62
Date: Tue, 29 Sep 2009 19:39:17 GMT
Content-Type: text/css;charset=utf-8
Connection: keep-alive
X-Powered-By: PHP/5.3.0
Expires: Wed, 29 Sep 2010 19:39:17 GMT
Cache-Control: public, max-age=31536000
Vary: Accept-Encoding

In short, check the configuration you use for default_charset in your php.ini file and don’t use any quotes unless you need to the following works fine in my testing:


default_charset = utf-8

Howto: Backup your iPhone on another machine

Jane asked -

“I’m nowhere near my iMac, and won’t be for weeks. I need to backup my iPhone onto my MacBook Pro or external hard drive today. How?!”

To which the answer is, suprisingly, use iTunes.

It turns out that once you have connected your iPhones to iTunes on another Mac you can just right click on the device and select backup like so:

backup-iphone

Hopefully this will help other people in a similar situation in the future.

Solving confusing ssh problems

Last night I was setting up my new Time Capsule and suddenly lost access to all my remote servers over ssh.

All I got was the following error upon connection ’ssh_exchange_identification: Connection closed by remote host” and everything I searched around the web implied this was to do with too many connections to the server or incorrect reverse dns setup.

Neither or these issues applied to me and for a while I was stumped until it dawned on me that the Time Capsule had a much better NAT implementation it in with specific handlers for different protocols and I have all my servers configured to accepting incoming ssh connections on a non-standard port so as to reduce the number of ssh probe attacks.  Once I opened up a different port that isn’t used for other protocols by default it all burst back into life.

Hopefully, this will help someone who encounters the same problem in the future!

Documentation links

During a discussion on #wordpress-dev this evening I came up with the following oneliner for generating links to phpdocumenter output based on function name to support a php.net like lookup solutions:


curl "http://phpdoc.wordpress.org/trunk/li_WordPress.html" | grep "wp_list_pages" | sed "s/^.*'\(.*\)'.*'.*'.*$/http:\/\/phpdoc.wordpress.org\/trunk\/\1/"

It needs some optimisation though.  It’s too long to tweet!

WordPress developer documentation

Tonight I have restored my WordPress phpDocumentor site into functionality and added bbPress and BackPress into the mix too.  The root of the site is http://phpdoc.ftwr.co.uk/ and it is set to automattically update every 30 minutes as things change.

Unplanned downtime

Due to hardware issues this site has seen some unplanned downtime of late.  The server that was hosting this site (and providing smtp/imap/dns/ircbot services for ftwr.co.uk) started playing up and would randomly lockup hard.  After a few days of trying to resolve these hardware issues I decided that it was time for a two pronged response – build a new server to replace the current one and start to move some of the services off onto a VPS.

I had been planning for a while to get a slicehost vps server to move all the web properties onto so as to have more bandwidth available for visitors – this site was shifting 5G of traffic a month up my adsl connection on it’s own!

Hopefully all of this site should be running fine now I have got apache2/mysql tuned to run in the limited environment of my 256M slice and wp-super-cache up and running.

Please let me know if anything is broken!

Subversion integration for Finder

In order to answer a plea for help from a commandline phobe for an easy to use subversion client for OS X I went searching for a TortoiseSVN equivalent.  Tortoise is the subversion client for Windows so I hoped that someone would have developed something similar to integrate with Finder.  After a little bit of searching I found scplugin and recommended it.  I finally got a chance to try it out myself this evening and so far it looks really good.

rsi prevention

Can anyone recommend a good rsi prevention program for OS X?  I am used to using WorkRave on windows at $dayjob and this works very well.  Looking around it seemed to be WristSaver that was recommened for OS X but it is nowhere near as fully functioned as WorkRave.  Or am I just going to have to look into porting WorkRave to OS X?



d
go to dashboard
l
go to login
h
show/hide help
e
edit post/page
r
comment on post/page
m
go to moderate comments
esc
cancel