Posts Tagged ‘Blog’

Windows Live Writer

Saturday, June 19th, 2010

I’ve always liked the idea of using a desktop client to post to my blog. (Somehow, Google never managed to sell me on the browser-as-an-OS idea.)

Now that I have a laptop with Windows 7 on it, I’ve decided to give Windows Live Writer a test-drive. Here goes nothing.

Excuses

Saturday, May 22nd, 2010

Pick up ten random blogs on the Internet and at least one of them is sure to have an apolo­getic note from the author explaining why there have been fewer than usual updates recently.

Gather some statis­tics and add a punch­line, and I’m sure this will be a great xkcd strip.…

Minimizing Downtime

Wednesday, October 8th, 2008

Now that this site is hosted on my own server, I wanted ensure that the server is up and running most of the time. Although five 9’s is not my avail­ability target, I needed some mecha­nism by which changes and updates that I made to the site were not reflected in the produc­tion website (can I call it that?) until the right time.

The solution is a simple one: run a devel­op­ment website in parallel, so that all changes can be tested on that first. Updating the primary website would be like flipping a switch. Here’s how I managed this:

  1. Set up a new virtual host for the devel­op­ment site.
  2. Set up a new database for the devel­op­ment site and populate it with existing records.
  3. Update the WordPress config­u­ra­tion file to select a different database based on the current working directory.
  4. Set up server authen­ti­ca­tion for the devel­op­ment website.
  5. Write an init script to copy (rsync) all the files from the devel­op­ment site to the primary one. Exclude the authen­ti­ca­tion files like htpasswd, of course.
  6. Set up a depen­dency on the new script in Apache, so that restarting the service also restarts Apache (this is useful at times).

It’s as simple as that!

Scripting Magic

Sunday, October 5th, 2008

It’s amazing how much can be achieved with the help of a few scripts. If you come to think of it, scripts are the original mashups that Web 2.0 has vener­ated in recent times.

Today, I decided that I would have a “Now Listening” box shown on my blog — I’m not sure if it is visible at this moment — which would display the name of the artist of the currently playing track on my computer. So here’s what I came up with -

  1. A Bash script that would use DCOP to query Amarok, deter­mine the currently playing song, and update a tempo­rary file accordingly.
  2. A small PHP script that would read the file and display this infor­ma­tion, but only if it is available.
  3. A set of CSS rules to format the gener­ated XHTML.
  4. A cron job to execute the script every minute.

Voila! It’s done…almost like magic.

A Fun Way To Spend A Saturday

Saturday, October 4th, 2008

Don’t try this at home, kids.

  1. Open a console window on your trusty old Linux box.
  2. Find a WordPress plugin you don’t need.
  3. Start typing rm -fr /path/to/wordpress/plugin-name.
  4. Instead, type rm -fr /path/to/wordpress and press enter.
  5. Oops.
  6. Spend a few hours setting up your blog all over again.
  7. Sleep.

Step #5 is the part I love the most.

Time For Change

Saturday, September 27th, 2008

I know that the title of this post sounds like an election slogan, but that’s not what this is all about. This change is all about domain names and CNAME records, but I won’t say too much about it. The bottom-line is that I decided to host this site on my own server, rather than on a shared webhost, and with that change, I also decided to start the blog afresh. You may rest assured that this had nothing to do with being too lazy to port the old blog to a new location, but you’re not going to believe me are you?

If the site seems to be too slow to load, please leave me a message and I will urge my server to work harder. Don’t worry, it listens to me.