Finals

It's been a long time since I posted any code. My excuse is that I've written my dissertation and now have finals looming. Code will resume in the not-too-distant future.

In the mean time, I leave you with this xkcd cartoon:

PermalinkComments (0)

AppleScript for starting and stopping Apache and MySQL

Got a couple of pieces of AppleScript for starting and stopping Apache and MySQL which are too small to be worth posting as snippets.

Starting:
do shell script "/sw/sbin/apachectl start" password "MY_PASSWORD" with administrator privileges do shell script "/usr/local/mysql/bin/mysqld_safe > /dev/null 2>&1 &" password "MY_PASSWORD" with administrator privileges

Stopping:
do shell script "/sw/sbin/apachectl stop" password "MY_PASSWORD" with administrator privileges do shell script "/usr/local/mysql/bin/mysqladmin -u root -pROOT_MYSQL_PASSWORD shutdown" password "MY_PASSWORD" with administrator privileges

You will obviously need to change MY_PASSWORD to your admin password. You need to change ROOT_MYSQL_PASSWORD to your root MySQL password, or another user name/password combo with shutdown privileges. Note: there should not be a space between -p and ROOT_MYSQL_PASSWORD.

Also, the path to apache/mysql might need changing. You can find out where they are by running which apachectl and which mysqld_safe in the terminal.

Just paste the code into Script Editor, and save how/wherever you like. I save mine as run-only executables which show up nicely in Quicksilver.

PermalinkComments (0)

CakePHP ACL code posted

Just a heads up to let CakePHP coders know I've posted a new snippet which extends slightly ACL usage within Cake apps. It's been posted to Trac for some time, but I don't know whether it'll be merged into the core.

Take a look.

PermalinkComments (0)

Host move complete

Well, the move is done.

I've moved to DreamHost, because I wanted a cheap host who had SSH access and other goodies to play with (RoR and Subversion particularly). With a $99 discount, it's cheap enough that I can just discard it after a year if it's not good enough.

My first observation is that it's noticeably slower than the old host. Especially MySQL as the database is on a different machine. It might be worth looking into installing a local copy if possible.


Finally, DreamHost have disabled PHPs allow_url_fopen ini setting, which breaks my favatars code. I've fixed my own copy to and will upload a new version as soon as I've more fully tested it.

Edit:
There also seems to be a problem with escaping characters to go into the database. Something else to fix…

PermalinkComments (0)

Moving hosts

I'm currently in the process of changing my hosting provider. Hopefully the move should go smoothly, but not having transferred a live website between hosts before there will probably be something I've forgotten. So please, if something seems wrong or this site just vanishes from the face of the internet, rest assured that I'll be panicking working to fix it.

PermalinkComments (0)