Skip to main content

Posts about blogging (old posts, page 1)

Upgrading Wordpress with Mercurial

Since Mozilla has started using Mercurial for source control, I thought I shoud get some hands on experience with it.

My Wordpress dashboard has been nagging me to upgrade to the latest version for quite a while now. I was running 2.5.1 up until today, which was released back in April. I've been putting off upgrading because it's always such a pain if you follow the recommended instructions, and I inevitably end up forgetting to migrate some customization I made to the old version.

So, to kill two birds with one stone, I decided to try my hand at upgrading Wordpress by using Mercurial to track my changes to the default install, as well as the changes between versions of Wordpress.

Preparation:

First, start off with a copy of my blog's code in a directory called 'blog'.

Download Wordpress 2.5.1 and 2.6.3 (the version I want to upgrade to).

Import initial Wordpress code:

tar zxf wordpress-2.5.1.tar.gz # NB: unpacks into wordpress/

mv wordpress wordpress-2.5.1

cd wordpress-2.5.1

hg init

hg commit -A -m 'wordpress 2.5.1'

cd ..

Apply my changes:

hg clone wordpress-2.5.1 wordpress-mine

cd wordpress-mine

hg qnew -m 'my blog' my-blog.patch

hg locate -0 | xargs -0 rm

cp -ar ../blog/* .

hg addremove

hg qrefresh

cd ..

The 'hg locate -0' line removes all the files currently tracked by Mercurial. This is needed so that any files I deleted from my copy of Wordpress also are deleted in my Mercurial repository.

The result of these two steps is that I have a repository that has the original Wordpress source code as one revision, with my changes applied as a Mercurial Queue patch.

Now I need to tell Mercurial what's changed between versions 2.5.1 and 2.6.3. To do this, I'll make a copy (or clone) of the 2.5.1 repository, and then put all the 2.6.3 files into it. Again, I use 'hg locate -0 | xargs -0 rm' to delete all the files from the old version before copying the new files in. Mercurial is smart enough to notice if files haven't changed, and the subsequent commit with the '-A' flag will add any new files or delete any files that were removed between 2.5.1 and 2.6.3.

Upgrade the pristine 2.5.1 to 2.6.3:

hg clone wordpress-2.5.1 wordpress-2.6.3

tar zxf wordpress-2.6.3 # NB: Unpacks into wordpress/

cd wordpress-2.6.3

hg locate -0 | xargs -0 rm

cp -ar ../wordpress/* .

hg commit -A -m 'wordpress-2.6.3'

cd ..

Now I need to perform the actual upgrade to my blog. First I save the state of the current modifications, then pull in the 2.5.1 -> 2.6.3 changes from the wordpress-2.6.3 repository. Then I reapply my changes to the new 2.6.3 code.

Pull in 2.6.3 to my blog:

cd wordpress-mine

hg qsave -e -c

hg pull ../wordpress-2.6.3

hg update -C

hg qpush -a -m

Voilà! A quick rsync to my website, and the upgrade is complete!

I have to admit, I don't fully grok some of these Mercurial commands. It took a few tries to work out this series of steps, so there's probably a better way of doing it. I'm pretty happy overall though; I managed a successful Wordpress upgrade, and learned something about Mercurial in the process! The next upgrade should go much more smoothly now that I've figured things out a bit better.

Re: Manifestestations of a more confident atheism

Christian,

Because man is a rational creature, he wants to understand the universe in which he lives. Both religion and science are ways for man to pursue this quest for truth.

I don't understand how Ricky's testimony, while honest, is convincing. He doesn't give any reasons for this conversion other than the fact that his older brother asked him, "Why do you believe in God?", and he felt that neither he nor his mother had a satisfactory answer. I suppose he was saying that if his mother didn't have a satisfactory answer, then one must not exist? Nothing against his mother, but just because you can't explain something with 100% certitude doesn't mean you can't believe in it. Most scientifically-aware people would agree that the speed of light is the fastest that anything can travel in our universe, but would be hard pressed to explain why.

So, I would invite you to investigate why other people have decided that atheism just doesn't make sense, and how faith and reason can and should complement one another. Religion, if true, can stand up to inquiry and criticism.

Great authors and thinkers such as C.S. Lewis and G.K. Chesterton have made this discovery.

More recently, Jen at Et Tu? has a written a very moving story of her conversion from atheism, as well as a piece on why she believes in God in the first place.

I made this discovery myself about three years ago now. Part of the reason was that I realized that the natural sciences can't explain the "why" of things. At the time I didn't think that there was necessarily a purpose to life, the universe, and everything...but the more I thought about it, the more I wondered why it was that the scientific method worked at all? We rely on our reason, logical and mathematical principles to explain the phenomena of the world around us. But why do our reason, logic, and math have any capability to explain? Math and logic cannot be explained by science, rather, they form the foundations of science. So why are math and logic true?

At the same time I was coming to the realization that there is a limit to human knowledge. I figured that since there is an infinite amount of knowledge to know (e.g. the set of transcendental numbers or the digits of pi), and since no person or group of people will ever live for an infinite amount of time, then some things will always remain outside the realm of knowable things. This meant to me that I could never disprove the existence of God...but could I prove it? This is the position of the agnostic: that we can't really know one way or another.

The position of the Christian is that not only does God exist, but he wants to tell us about himself; so much so that he became one of us. I began reading more about what the Catholic Church had to say in the matter. The Church's bold claim is that it is the earthly institution that was founded by none other than God, the Creator of the universe who became man. To my surprise, I found it to be an intellectual treasure trove. The Catholic Church is, and always has been, a great defender and promoter of reason and the sciences. Nothing in Christianity is contrary to reason. At the same time, it reminds us of the limits to human knowledge, and reveals truths to us that our reason could have never reached on its own.

All of this is my long-winded way of saying to you, and to all people of good will, that Christianity is not the enemy of reason, nor of science, nor of any legitimate human endeavour. It deserves a serious and honest analysis before it is discarded as logically fallacious or as merely an emotional crutch.

Cheers

Spam Attack?

In the past few days I've had around a 100x increase in hits to my site...And also a barrage of spam comments coming in.

The hits aren't coming from any one IP, but they don't seem to be referred by anywhere (Referrer header is empty). The User-Agent is typically "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)". I do use some JavaScript traffic tracking on this site, and these hits aren't showing up, which leads me to think that either hoards of IE users have JavaScript turned off, or this is some new distributed trojan spam attack.

Anybody else noticed this recently?

Technorati tags:

spam blog blogging comment

Mark Jaquith's Wordpress 2.0.3 upgrade

I have downloaded and installed Mark Jaquith's WordPress 2.0.3 Changed Files ZIP package.

I have verified that the Changed Files ZIP package contains nothing that is not in the original WordPress 2.0.3 download, so it is safe to use as far as I can tell. Verifying this took more time than actually doing the upgrade!

I think the WordPress release team should provide something similar, as this is a much more convienient way of upgrading for those of us with just FTP access to our web hosts.