|  About Me  |  Blogs  |  Photos  |  Publications  |  Resume  | 

Archive for the 'Blogging' Category

Display random comic strips from rss feed

Tuesday, December 6th, 2005

I was growing bored of my old wordpress theme so I set out to do something more fun. I wrote a python script to return a random comic strip from the dilbert rss feed and set it as the background of my header.

The script, written in mod python, uses feedparser to grab an image [...]

Sidenote
  • Safari/Konqueror fix: It appears that on konqueror based browsers the styles defined in the page header takes precedence over the ones in css. I had some duplicate definitions for header background in the header file which overrides the css so I had to delete that. This makes sense, however there was another behaviour which doesn't. The width and height css attribute for the header id doesn't seem to be honoured on the page. I had to specify it in the page for it to work properly, i.e.,
    <div id="header" style="width:100%;height:211px;">
    
    Thanks to Diego for pointing this out :)

Fixed WordPress problem with escaping quotes in <pre> tag

Friday, December 2nd, 2005

I finally got around to tracking down why wordpress is stubbornly putting a backslash against all my quotes in pre tags, i.e.,

\”text\”

The problem lies in this line of function wpautop,

preg_replace(’!(<pre.*?>)(.*?)</pre>!ise’, ” stripslashes(’$1′) \. clean_pre(’$2′) . ‘</pre>’ “, $pee);

The s option in !ise says to treat the input as a single line, somehow this [...]

WordPress

Thursday, June 16th, 2005

Considering switching to WordPress because it’s free and dynamic. Can’t wait to try it out when my new server is ready!

MovableType spam blocker

Wednesday, December 15th, 2004

With popularity comes SPAM I’m really fed up the massive systematic, automated spam I’m getting on my blog comments so I installed the MT-blacklist plugin which performs content-based comment/trackback spam blocking.

Installing Movabletype 3.1rc1 beta

Thursday, August 26th, 2004

Installation notes for movabletype 1.3rc1 using mysql.

Create new database and user priviledges for mt beta

$ mysqladmin create mtbeta
$ mysql -uroot mysql
$ grant all privileges on mtbeta.* to ‘movabletype’@'localhost’ identified by ‘password’ with grant option;
$ mysqladmin reload

Configure movabletype


CGIPath http://ibao.hopto.org/mt-beta/

#DataSource ./db

ObjectDriver DBI::mysql
Database mt-beta
DBUser movabletype
DBHost localhost
DBSocket /var/run/mysqld/mysqld.sock

Place password in /var/www/mt-beta/mt-db-pass.cgi,

Set apache permission.

<Directory “/var/www/mt-beta”>
Options Indexes [...]