Having your cake and eating it – UserCake

July 21st, 2014

Setting up Usercake

The setting up of UserCake is pretty straight forward, and is very straight forward and is listed below:

However the configueration docs can be a little less than clear.

So how do you protect your pages

There are three basic functions which are used to protect pages in UserCake

It is the function which ought to be used if you want the admin panel to dynamically control which permission levels have access to a page.


This function checks if a user has been granted a Permission Level. It’s useful if you have content on a page (such as admin features) which you only want specific users to see. You simply specify the Permission Levels who ought to have access as an array.


This function checks if the user is logged in. It’s useful if your permission levels change often, and you have a page you want everyone to have access to, or for public pages where you want some parts only to be visible to logged in users (such as the box to post comments on a blog).

The isUserLoggedIn(); function is probalbly the most used of these functions, where it allows people to see the content that only a logged in user will see, this means that if you want a logged in user to access the page, then he can do so, but you can still see the page, If you put this in a nice if statment.





Database PDF Manafacture

December 11th, 2013

Database PDF Manafacture

Their comes a time when people want stuff printed, and no matter what you do, it will still have to be printed, and if your running big events, then that printing can get pretty troublsome, I was involved in building a little bit of a site, where we wanted to reduce people input in to generating printed documents. Essentially taking the copy and pasting out of the job, and as the posh people say “structering the data”.



So this meant HTML form to PHP to Databases and then to PDF’s

I used PDF’s as webpages don’t normally print very well and PDF’s are almost everywhere, they give a nice printed page, which you can print, and the most important thing is people understand them.

Tools used

  • jquery
  • PHP
  • MySQL
  • tcpdf
  • HTML

The jquery was use in form validation, as show in a earler post http://patrickrice.net/blog/2013/10/form-validation/

PHP was used to process the forms, in the standard way and then insert the code in to the database, but using Prepared statements and stored procedures (http://php.net/manual/en/pdo.prepared-statements.php)

Then using the database and tcpdf (http://www.tcpdf.org/), you could generate pdfs on the fly from the data base, here is a sample of the code below.

CryptoLocker virus/ransomeware

December 10th, 2013

Just to make people aware, there is a new virus (technically ransomware (http://www.microsoft.com/security/resources/ransomware-whatis.aspx) ) that is doing the rounds. It’s been in the wild for a while, but seems to be getting more media attention these days.

Basically once you click on a e-mailed link it will encrypt files it can access on your hard drive. The engineering beauty of this virus is that it encrypts your files, and then contacts you to demand a ransom in the form of bit coins (http://bitcoin.org/en/) to decrypt your drive. So it becomes a case of pay up or your data is gone, if you have backups on another drive you should be able to restore to that drive, however if your do not have backups your data is basically gone as the encryption is uncrackable at the moment.

The above has a less chance of happening if you are running non system administrative privileges, You can read more about how a US police force had to pay to get there data back on the link below, it’s a pity they didn’t have backups. http://www.theguardian.com/technology/2013/nov/21/us-police-force-pay-bitcoin-ransom-in-cryptolocker-malware-scam

You can read more on: http://www.f-secure.com/weblog/archives/00002640.html

Form Validation

October 11th, 2013

Form validaion is a bit like picking spuds, you know you want to eat the spuds, but you got to dig them and then pick them (spuds are potatoes for the non Irish reading this)  so how do we do this efficiently, well I’ve been starting to use the jQuery Validation Plugin it seems to work pertty good, and it’s plain and simple, so how does it work, well the doc’s are a bit sparce, and it’s javascript, which isint the easyest language in the world to program in.


so here goes:

Put below at the top of your html web page, this collects the jquery and the jquery validate library’s


Then you need add the scripting part, i do a standard debug check to see that jquery works first.


Now we have the script ended we can start the HTML and the form



Thats pretty much it,  yes you can do alot more fancy stuff, but this is a start to get you going.

An HTML option list for the coutnies of Ireland

October 10th, 2013

This is a reminder for myself, but when your doing a site and your looking for a HTML option list for all the counties of ireland see below, for those that are wondering the hell I’m on about, see below:



List is below



The back to College/School laptop 2013

August 26th, 2013

So your back in college and you need a computer. So what to buy well it’s always a tough choice, but you don’t need to go into the thousands for a PC these days. the lower end laptop will do the job for most things, and the way to go here is low end.

  • Keyboards: if your buying a laptop be sure to try it out and make sure you actualy type on it, and be sure to type a paragraph on it, cause if it’s a bad keyboard your stuck with it for 3-4 years.
  • Touchscreens, yes the are here, you have to search them out as they are not on many lower end specks. Windows 8 will work better with them rather than a normal screen so it is worth the investment.
  • Memory, go for as much memory as you can, Memory is not hard disk space, we’re looking here at on-board memory, it will be quoted like 4096MB which is More than enough if your running windows 8, also make sure you can expand it.
  • Hard drive space: Don’t worry about hard drive space 160GB will be enough for most people, if your into music and video, you can always get an external USB drive. USB if you can come across USB 3.0 on a system, then that’s a plus.
  • Screen size, rember the bigger the screen the more its going to cost to replace it if some one sits on it, of if it falls off the bed/desk or what ever!, a 17inch screen is going around €200 for a replacment, and its not an easy job, also if you can buy a standard screen size you will pay standard money to replace it.

The next thing is software:

  • Have a look at   www.studentsoftware.ie/   This is a site for purchasing student software at discount prices.
  • Office software, well Microsoft office is the standard, but you can use open office or libre office, once you have made sure that you save everything as Microsoft file format and it will work fine.
  • Photo-shop is a standard but GIMP gives you all the functionality that most people need, it’s also open source.
  • The Zotero plug-in for Mozilla FireFox, is great for citations.
  • LYX is great for producing papers and Theseus, and is much better at handling documentation than word.
  • If your a publisher look at scribus, its open source desktop publishing system, you could always pay for quark.

Happy shopping, and don’t spend too much!

Getting the Service Tag/ Serial Number through CMD

August 8th, 2013

This is a reminder for myself really, but its handy for referance

To retrieve serial number of the computer run the following command from command line

To retrieve model name of the computer run the following command from command line

This code doesn’t return information for all computers but it seems to work on  windows 7

Are Mobile phone companys going to go bust?

August 7th, 2013

I ‘ve been thinking for a while about smart phones, and maybe that the smart phone may kill the mobile phone company, how could this be ?….. well if you look at the way “Whats up” the messaging platform has taken off (below) http://siliconrepublic.com/comms/item/33724-mobile-network-killer-or/

It seems that people are starting to see that  you can message, and talk to people with out a mobile signal, and just a wifi signal, by using skype and whats up and viper. So where is this going, well if people can message each other with out the need for a mobile network, then why does one need a mobile network? I wonder what will happen when mesh networks start to become more widly avaibale on handsets, This is already starting on the Android platform with projects such as below

The Serval Mesh


There could be interesting times in the mobile networks, as we have near 100% moible phone penetration in some markets.

Map of Ireland with broadband

August 6th, 2013

Ireland off line have come up with a map of ireland, in relation to boradband, Might be worth checking out, if your trying to get good broadband.

Open Switches

May 10th, 2013

Facebook looking in to open switches, people are starting to figure out that, a switch is just a PC with a lot of IO going on, VMware and others are getting in on the act too. It could be interesting times for Cisco and very destructive technology for the networking industry.