Archive for August, 2009

Duplicate Wordpress site for local development and testing environment

Posted in mysql, wordpress on August 6th, 2009 by David – 3 Comments

1. Download all files from eg http://example.com, upload to eg http://localhost/example/.
2. Export mysql database from example.com
3. Create a local mysql database with the same user, password and database name. These can be found in wp-config.php
4. Import the database into your new local account
5. Log in to the database, and do:
[sourcecode language='sql']
update wp_options set option_value=’http://localhost/example/’ where option_id=1
[/sourcecode]
You’ll now be able to log in at http://localhost/example/wp-admin, using the same username and password as http://example.com/wp-admin.
5. In Wordpress, click ‘Settings’ and change the blog address to your local address.
6. Profit!

HTML syntax highlighting for Silverstripe .ss template files in vim

Posted in silverstripe, vim, xhtml on August 4th, 2009 by David – 1 Comment

By default vim opens .ss files with some other file format syntax highlighting.

To enable HTML (actually XHTML) syntax highlighting on your .SS Silverstripe template files, create (or edit) your ~/.vim/filetype.vim file. Then enter this:

au BufNewFile,BufRead *.ss      setf xhtml

Then open a .ss file and it’ll give you nice HTML syntax highlighting. And because it’s in your home directory, it’ll keep working even after you upgrade vim.