MPs’ Expenses – Interesting claims by David Davis MP

June 18th, 2009

As you might have seen in the news, the UK Parliament has made available records of MPs’ expenses from 2004/05 – 2007/08.

Obviously these records can reach hundreds of pages for each MP and will take some time to sift through. It seems to me that by applying a bit of ‘crowdsourcing’ to the job might help us to pick out the more ‘interesting’ claims that our MPs have made.

Following that line of thought, I’ve had a look through the claims made by one MP and noted items that jump out at me.

If you’re interested in transparency in politics why not do the same? It’d be great if you could post a comment here linking back to your post so there is an easy to follow thread.

2007/08 – David Davis MP | Haltemprice and Holderness

David Davis bagged himself an 8GB iPhone along with docking station, remote and case at a cost to the taxpayer of £339.00. This is in addition to a monthly bill from Vodafone, plus a regular payment marked ‘Cellhire’ (no invoice I can see).

A 24″ HDMI LCD. Not cheap at £463.06

£100 claimed each month in petty cash.

£2820 to a paid to an invoice headed ‘People Innovation’. The only company I can find of this name is a company listed under the ‘Business and Management Consultants’ category in Horsham, West Sussex.

A claim for £705 was made for ‘data recovery’ which raises the question, why was important data not backed up or easily recoverable in the first instance?

Posted by Chris

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this

Pirate Party UK Launches

June 12th, 2009

The Ubuntu-UK mailing list brings news of the emergence of the ‘Pirate Party UK‘ (PPUK).

Inspired by the Swedish Piratpartiet, the PPUK is a single issue political party campaigning principally for the reformation of copyright law and patent systems.

Interested in the political/legal concepts of Free Libre and Open Source software? Give PPUK a visit.

Posted by Chris

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this

Making ‘ondemand’ CPU frequency scaling more responsive

May 12th, 2009

For a while now I’ve found that ondemand CPU frequency scaling (enabled by default) makes my laptop seem sluggish under Ubuntu.

Basically the CPU speed doesn’t seem to increase quickly enough to keep up with the sudden brief bursts of demand caused when using Gmail, or playing Youtube videos for instance. Applying information found on this website seems to give a more responsive system.

echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/ignore_nice_load
echo 40 > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold

This changes the default behaviour of the ondemand governor to force it to take into account background processes, and tells it to increase CPU speed when your CPU usage exceeds 40% rather than 95% (as is default).

Because /sys/ is a virtual file system created each time you boot your system, any changes you make are lost after a restart. Add the lines above to /etc/rc.local (read here for more on rc.local) to have your chosen settings applied each time you start Ubuntu.

Have fun.

Posted by Chris

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this

Symfony – cssTabsPlugin and security

March 11th, 2009

Hi all,
I have been working on a Symfony (ver1 of the MVC) based application. It needs really tight security that is really granular. So I did what most people do and installed the cool sfGuardPlugin.

It works a treat.

But.. I started to look at how I secure individual buttons, or sections of code etc.
The best way would be to create a load of credentials, e.g view_token, add_token, edit_token, view_token_history, etc etc which can then be grouped together to allow access via groups or individual assignement.

Then I started thinking about the use of hardcoded text within the code, such as the following example and ‘viewtoken’.

$sf_user->hasCredential('view_token');

I don’t like hardcoding anything if I can help it, so installed the sfSettingsPlugin, added the line of code:

include_once (sfConfigCache::getInstance()->checkConfig('config/db_settings.yml'));

to my controllers (it doesn’t mention that anywhere on the plugin site or within the code!), did a quick symfony propel-build-all-load & symfony cc and added a few settings.

The settings are available in your app as a normal CONSTANT, I created view_token with the value of viewtoken, so I could access it within the application as the constant VIEW_TOKEN.

You may wonder why I didn’t just hardcode the values? I am not sure at the moment, its a lot of hassle so far, but at least it will be highly configurable :)

Any ways, we have installed the sfSettings plugin, I have the very good wordpress style menus plugin called sfCssTabsPlugin already installed and working well. Finding this great add on that allowed the sfcsstabs to recognise security credentials that are based in any modules /config/security.yml, I thought great!

But I hit a snag, once installed and working it only recognised the first credential of that user.
If you have a lot of credentials, and I do, then it fails :(

I found a work around though:
In \plugins\sfGuardPlugin\lib\user\sfGuardSecurityUser.class.php
I replaced:


return $this->hasCredential($credentials);

with:


$permissions=$this->getAllPermissionNames();
if(in_array($credentials, $permissions)) {
return true;
}else{
return false;
}

This gets all the permissions, those set within a group and those assigned to an individual user.
I am not sure if this is best way to do it, I am sure writing another method within the model would probably be a better bet, but I am soooOO lazy. If I do (or you?) then I will post it on here.

The above code allowed me to get all the credentials and display individual elements of the menu according to the security credentials of the user.

thanks

Adam

Posted by Adam

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this

Speeding up Firefox 3 in KDE 4 (Kubuntu Intrepid)

March 9th, 2009

Having just moved across to Kubuntu Intrepid I found that Firefox looks a little crappy by default. This can be remedied pretty quickly by grabbing this theme, created especially for KDE 4:

http://ramonantonio.net/kde-firefox/

Secondly some people suggested that they found Gmail scrolling a little slow on some computers. Disabling the Ubuntu Firefox Modifications addon (anyone know what this does anyway?) seems to give you a little extra speed if you need it.

Finally ensure you that you have ‘performance’ selected in CPU Policy. It’s easy to forget that power saving mode is on and find yourself wondering why your laptop is slow!

Posted by Chris

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this

Symfony – Prototype – Lightwindows – problems

February 13th, 2009

Hi all,
here is a problem (and solution) that tasked me for around 3 hours last night.
I am using Symfony MVC (ver 1.0) framework to create an intranet based application. A lot of the work is AJAX driven to help with usability.

I had a requirement to be able to create new entities from one page, the entity requires a large amount of information to be entered. I am not decided but the two choices I have tried are
a) Using a short form that reduces the amount of data needed to create the entity (e.g. just the name of the thing) and
b) A pop up modal window that presents the full form.

The first I implemented with no problems, fully ajaxed up and working – a good option really.
The second I decided to use the lightwindow plugin. After following all the instructions to make it work it just sat there mocking me, nothing happening. I use Firebug to help me decode the problems and this tool gave the following cryptic error:
"0x8057000d (NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN)"
I had to laugh – it reminded me of a Microsoft error message, similar to something BizTalk throws up if you forget to enable the first part of an orchestration (noob error!).
Any ways – a bit of searching on Google brings back this blog (thanks to Dave for putting me on the right track).

I then looked at the Prototype libraries that come shipped with Symfony 1.0 and doh! they are older than those required for lightwindow, simple error, simple solution. It just took me a long time to figure out, and I thought other noobs may be in a similar situation searching for a simple answer.

Downloading and installing the prototype plugin solved the prototype problem gave me great looking pop up windows (just don’t forget to clear your cache using symfony cc).

Now all I have to sort out is the stupid cross browser problems (IE in particular!) ggggrrrrrr.

Posted by Adam

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this

Arggghhhh it’s the end of the world. Google is broken!

January 31st, 2009

Lock your doors, stock up on supplies and withdraw all of your money from the bank for Google is broken!

It won’t be long now before mobs rampage through the streets destroying small businesses and legging it with pilfered tellys. This could be the end of the world as we know it!

Currently clicking on the result of any Google search brings up a page warning the user that the website is a potential risk, and does not allow the user to continue on to it.

Be afraid folks, be very afraid!

googlebroken

Update: A little while later Google started working properly again. Normality was restored. Sheepish looking folk gently placed nicked tellys back through the shattered windows of Currys and jogged home.

Posted by Chris

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this

Getting a symfony plugin to work

January 14th, 2009

Hi all,
I am working on a web based application for my work place. I am building it in a php using the MVC framework Symfony.

Symfony has learning curve, especially if you are new to the MVC setup. This post is not about MVC but about a small problem I had trying to installing a plugin.

Symfony allows you to install plugins to the framework that provide a specific purpose, the one I was trying to install was called AdminQuickCreatePlugin. If you can imagine you have a form that is all about a ‘person’, and on this form you a list of “organisations” that this person may work for, but as you start to fill the form in you realise the organisation the person works for is not in the list. So you would have to go back, create the organisation, then come back to the form and fill all the details back in for the person (you have had to update the select list to show the new organisation).
This plugin creates a small button that will open the form for an organisation, but the magic is that it will save the current forms session info and once the organisation has been created it will reopen the person form but fill in all the details you had entered but also add the new organisation.
This makes web apps a little easier to use.

Any way – the problem was all around the way symfony installs plugins, using PEAR. It refused to install normally due to a md5sum error.
To rectify the problem I had to enter the .tgz, edit the package.xml. I did use a md5sum.exe app to recreate the md5sum, but all the md5s looked ok?!
So finding the ‘<file’ I deleted the md5sum=’7630f0d1fbc…….’ part.
I then recreated the .tar.gz and used ’symfony install-plugin /plugin.tar.gz’

Hey presto.. install without a problem now.
Hopefully this may help anyone who has a similar problem.
Just a word of warning though, the md5sum is used to make sure the file hasn’t been compromised, so always do a virus check.

ta

adam

Posted by Adam

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this

Problems installing Microsoft SQL Server Express 2005

January 5th, 2009

Hi all,
I had to install SQL Server Express 2005 edition on my works laptop so I could develop a small database driven application.
I have Visual Studio 2005 already installed and thought installing SQL express would be a simple process, oh no..,…

First attempt – it installed the following without a hitch:

  • SQL Setup Support Files
  • SQL Native Client
  • SQL VSS Writer

but then failed miserably on the SQL Server Database Services, checking through the log files showed nothing out of the ordinary. The summary file stated that the install had been a success, though the installer then wanted to report a fail back to Microsoft headquarters.

So time to start digging, fire up Google and find out who else has had a similar problem, quite a few by the looks of it.

My first attempt at a remedy was to use add/remove programs to remove all traces of the botched install. Then use regedit to remove the following keys (if present) /HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Microsoft SQL (xxxx) where (xxx) is anything after SQL..

After a reboot I tried another install – same error message.

After many variations of the above I then looked slightly further afield, at the MSXML6 parser, this is a pre-requisite of SQL Server Express 2005, and I had downloaded it from the Microsoft download page MSXML6.exe Parser and attempted to install it.

It failed stating that the version installed was newer than the version I was attempting to install, but after more headaches etc I looked at the dlls msxml6.dll and msxml6r.dll and noted that they were not newer.
I tried to remove MSXML6 parser using the add/remove programs – it replied that it couldn’t as it wasn’t installed!
But the .dlls could be seen – and they were registered?! So I unregistered them both using regsvr32 /u and tried again to remove the app using add/remove programs. No luck.

I then downloaded Windows Installer Clean Up tool and scrolled down to find the rouge MSXML6.
Highlighted the app – clicked ‘Remove’, then attempted an install of msxml6.exe, it didn’t complain about any previous version (onto a winner?) and installed correctly.
I then, tentatively, tried to install the MS SQL Express 2005 – and after an age it installed fully…

Wahoo… we have a winner.

All I have to do now is write the application… and I am more of a MySQL man myself.

;o)

Adam

Posted by Adam

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this

Getting your eGalax touchscreen monitor working on Ubuntu Hardy

November 12th, 2008

So, you’ve got a touchscreen monitor and you’re wondering why it doesn’t work properly? Lets see if we can get it up and running!

After connecting the touchscreen monitor’s USB cable to your PC and restarting, check out the USB devices on your system by running the command ‘lsusb’. If you see a line with the words:

D-WAV Scientific Co., Ltd eGalax TouchScreen

then we’re in business. I know how to set that one up!

Give the screen a sneaky tap with your finger. Marvel at how the computer seems to recognise a mouse click event (you may notice it highlights some text, or scares a small child from your PC case), but doesn’t yet doesn’t recognise mouse movement events.

Go on over to http://210.64.17.162/web20/TouchKitDriver/linuxDriver.htm and select the file called ‘Kernel 2.6.x with xorg 1.4.0 only’. At the time of writing the direct link to this file is here. It may have moved by the time you read this.

Anyway. Extract the TouchKit-2.03.tar.gz file. It contains a folder with 2 files and a tar archive in it. Good times.

At the command line move to the TouchKit folder you just extracted and run the following command:

sudo sh setup.sh

Wait a sec and be rewarded with the following menu. I’ve left in the choices I made.

(*) Linux driver installer for TouchKit controller

(I) Begin to setup TouchKit Linux driver.
(I) Checking user permission: root, you are the supervisor.
(I) Extract TouchKit driver package to /usr/local/TouchKit_x14.
(I) Create TouchKit utility shortcut in /usr/bin.
(I) Copy X module egalax_drv.so to /usr/lib/xorg/modules/input.

(Q) Which interface controller do you use?
(I) [1] RS232 [2] PS/2 [3] USB : (I) Please choose [1], [2] or [3]
(A) 3
(I) Using interface: USB
(I) Found a HID compliant touch controller.
(I) Found kernel module usbtouchscreen.
(I) It is highly recommended that add it into blacklist.
(Q) Do you want to add it into blacklist? (y/n) y
(I) Add kernel module usbtouchscreen into /etc/modprobe.d/blacklist

(I) Found X configuration file xorg.conf in /etc/X11.
(I) Add touch configuration into /etc/X11/xorg.conf.

(I) Please reboot the system for some changes to take effect.

Reboot your system

When the system comes back up you can calibrate and adjust your touchscreen by running sudo /usr/bin/TouchKit

Jobs a gud’un.

— Update

You may find that clicking on the desktop leaves irritating little selection box artifacts that wont go away. You can sort this out by changing the xorg.conf configuration that the TouchKit application generates.

Change SendCoreEvents to CorePointer (I edited out the default config at the top there). Problem solved.

Section “ServerLayout”
### InputDevice “EETI” “SendCoreEvents”
InputDevice “EETI” “CorePointer”
Identifier “Default Layout”
Screen “Default Screen”

Unfortunately though you may find that your mouse no longer works. Swings and roundabouts!

Posted by Chris

Post to del.icio.us Post to del.icio.us

Post to Slashdot Post to Slashdot

Digg this Digg this