Conor Mac Aoidh
http://macaoidh.name
conor@macaoidh.name
 

Search

Archives

  • July 2010
  • June 2010
  • April 2010
  • March 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008

Spam

4,729 spam comments
blocked by
Akismet

Tag Cloud

    bt broadband CMS conor's management system conormacaoidh conor mac aoidh content management system drums fast Fedora fedora 10 furasta furasta cms furasta org gnome guide hello world HTML icsp iPhone Java javascript joomla kde Linux Mandriva mc kennas Monaghan Music mysql php repository Scratch stealing the ceiling The Dominican Affair the pot smoking pirates the strats tutorial Twitter updates web design forum webme webworks weekly tweets Windows wordpress

Ads

Furasta.Org 1.0 Beta – 1st August

Posted Jul 5th, 2010 by Conor in in Furasta.Org

Furasta.Org version 1.0 Beta will be released on 1st August 2010. What will be in this beta? Almost everything required to run a website. The Beta is merely a formality to allow for unforeseen bug fixes.

I had planned to do so much with Furasta.Org, but I have been forced to narrow it down to a small list of features. Additional features will be added through the plugin architecture, and in time to the main CMS.

  • Editing Pages – the most obvious and fundamental feature, but I have added a few thing to this that I haven’t seen elsewhere.
  • Users and Permissions – It will be possible to set who can view certain pages, and even who can edit them. In the future I hope to expand on this section with User Groups, though they will not be included in this release.
  • Website Configuration – General settings, also including some new ideas I haven’t seen anywhere.
  • Template Management – Set what template or theme to use for the website’s appearance. Though not in this release, I hope to add an online template repository which one can browse from the CMS admin panel.
  • Plugin Architecture – One of the largest and most important features of the whole system. This complex architecture will allow other developers to use Furasta.Org to their advantage. Through the use of a “hook” system, vaguely similar to wordpress’s, I hope to offer the developer total control over almost every part of the CMS. In the future I also plan to add a plugin repository to the website, which will include verified, safe plugins and which will be installable from the admin panel.
  • Upgrade Manager – Regardless of what I have said so far; this is the most important feature. I was of two minds as to including this feature so soon, but I decided that If this was enabled then systmes would be updated smoothly along with new releases.

So there’s a lot in store – and the first website running the CMS will be Furasta.Org – live on the 1st August 2010.

No responses yet

OS X: Audio Alerts for PHP Errors

Posted Jun 22nd, 2010 by Conor in in Apple,Apple Script,Bash,PHP

Kae posted today about tackling this problem under Linux, but I’ve found that it’s quite a different task under OS X. Anyway here is how it’s done:

First you need to download the swatch package from here.

If you haven’t done it before you will have to set up cpan and it’s a lengthy process. Run cpan in the terminal. It’s safe to say yes to all the options. Once it’s installed you need to add some perl modules. In the cpan prompt add the following modules:

install Date::Calc
install Date::Format
install Date::Manip
install File::Tail

That’s the perl part finished anyway. Now change to the swatch directory and compile:

perl Makefile.pl
make
make install

Ok swatch should be installed now. So set up the configuration file: vim ~/.swatchrc Add the following lines to the file:

watchfor /PHP Parse error|PHP Fatal error/
bell 3

Save and return to the command line. Now to add swatch (and also optionally apache and mysql) as a startup item do as follows. Create a new directory named StartUpItems, then create the following files so your setup should look like this:

StartUpItems
StartUpItems/StartUpItems (a file with no extention)
StartUpItems/StartupParameters.plist

Now add the following contents to StartupParameters.plist:

< ?xml version="1.0" encoding="UTF-8"?>
< !DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">

    
        Description
        Various Startup commands including Swatch, Apache and MySQL.

        OrderPreference
        Late

        Provides
        
                Starts up Swatch, Apache and MySQL.
        
    

That’s just a file required by OS X to recognise the startup item, don’t worry to much about it. Now to the StartUpCommands file which is a bash script:

#!/bin/bash
. /etc/rc.common

StartService(){
        ConsoleMessage "Starting Apache, MySQL and Swatch"
        apachectl start
        /usr/local/mysql/support-files/mysql.server start
        /opt/local/bin/swatch --daemon --config-file=/Users/conormacaoidh/.swatchrc --tail-file=/var/log/php/php-error_log --pid-file=/var/run/swatch-httpd-errors.pid
}

StopService(){
        ConsoleMessage "Stopping Apache, MySQL and Swatch"
        PID=`cat /var/run/swatch-httpd-errors.pid`
        kill -9 $PID
        apachectl stop
        /usr/local/mysql/support-files/mysql.server stop
}

RestartService(){
        RunService stop
        RunService start
}

RunService "$1"

The file

/etc/rc.common

is provided by apple and makes the process a lot easier, though it is not needed. The lines in StartService and StopService do the opposite of each other but are very similar. You may need to change the apache and mysql start/stop commands according to your own setup. If you are using MAMP this file will start apache and mysql:

/Applications/MAMP/bin/start.sh

As for the swatch line you will obviously have to change the config file location and the php error log location to what’s appropriate on your machine.

And that’s it really. Then copy the items to the correct directory for OS X to recognise them:

sudo cp -R StartUpCommands /Library/StartUpItems

It is vital that you change the permissions or else the startup item simply won’t be executed:

sudo chown -R root /Library/StartUpItems/StartUpCommands
sudo chgrp -R wheel /Library/StartUpItems/StartUpCommands
sudo chmod -R 755 /Library/StartUpItems/StartUpCommands

That’s it. You can test the configuration by running SystemStarter -n -D which will emulate what happens when the computer starts, it is useful for de-bugging.

So restart you computer, load a php file with an error in it and your machine will beep thrice!

One response so far

Finally Finished

Posted Jun 21st, 2010 by Conor in in School

Today I sat my last Leaving Cert exam, Physics. I never have to go to school again… a feeling so good it’s impossible to put into words! I now finally have time to do what I want and enjoy the little things in life, like programming! I can’t wait to get started again..

Anyway I thought it would be interesting to write down what results I expect after sitting the exams, and then compare them to the results I actually get in August. I did all exams at higher level, and was aiming for 430, but i only really want 400 to be honest – anything over that is a bonus. Anyway here are the results I expect:

Subject Grade Points
1. English C1 70
2. Gaeilge B1 85
3. Maths C2 65
4. French C1 70
5. Art C2 65
6. Physics D1 55
7. Design & Communication Graphics D3 45
Total: 410

If I do get 410 points I should have enough to do my preferred course in UCD, Computer Science DN030. Two years ago the points were 300 for the course and last year 370. I don’t expect them to go over 400, but you never know taking into consideration that there was a 40% increase in CAO applications this year.
So I better get doing what I do best – party! To finish I would like to say a quote from one of the best movies of all time:

“This is the last of that sort of thing. I’m cleaning up and I’m moving on, going straight and choosing life. I’m looking forward to it already. I’m gonna be just like you: the job; the family; the fucking big television; the washing machine; the car; the compact disc and electrical tin opener; good health; low cholesterol; dental insurance; mortgage; starter home; leisure wear; luggage; 3 piece suite; DIY; game shows; junk food; children; walks in the park; 9 to 5; good at golf; washing the car; choice of sweaters; family Christmas; index pension; tax exemption; clearing gutters; getting by; looking ahead; the day you die.” Trainspotting

No responses yet

OS X VIM Syntax Highlighting

Posted Jun 12th, 2010 by Conor in in Linux,UNIX

Syntax highlighting isn’t enabled by default on OS X, though it’s easy enough to set it up, and a few other small enhancments at the same it.

Start by executing this command:

cd /usr/share/vim && sudo vim vimrc

After entering your password press i to enter insertion mode and add the following lines after the line set backspace=2:

set showmatch           " automatically show matching brackets
set binary noeol        " do NOT put a carriage return at the end of the last line
set backspace=indent,eol,start  " make that backspace key work the way it should
set history=100         " keep 100 lines of history
set ruler               " show the cursor position
syntax on               " syntax highlighting
set hlsearch            " highlight the last searched term
filetype plugin on      " use the file type plugins

" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if ! exists("g:leave_my_cursor_position_alone") |
\ if line("'\"") > 0 && line ("'\"") < = line("$") |
\ exe "normal g'\"" |
\ endif |
\ endif

The lines above add syntax highlighting and a few other useful things. The line set binary noeol is very important for web developers. For example if you are programming in PHP and you leave a space outside the closing ?> it will cause http headers to be needlessly sent. That line prevents that from happening.

Well that's it if you press ESC then type :wq you will return to the terminal. Try editing some files again and the highlighting should be enabled.

4 responses so far
Next Entries »



Conor's Blog is powered by Wordpress | Template design by Conor Mac Aoidh