About

Name:
Age:
Location:
Ben Speakman
24
London
I am a backend web developer with a passion for effective and efficient code and an interest in server administration.
  • Extensive experience in Object Oriented PHP and enterprise Linux enviroments
  • Competent in Java, C++, TCL and Windows Domains
  • Standards compliant HTML5, CSS3, JavaScript and AJAX
  • Confident in working in a team and experience working professionally in industry

Stats

Uptime:
Unique Hits:
Load Averages:
0 Hours
5169

Links

Download my CV here

Posted on February 20, 2012 by ben

I have developed a simple PHP class to connect to the online version of Microsoft Dynamics 2011.
It uses SOAP and logs in via Windows Live.

Download it from GitHub

$dynamicsClient = new dynamicsClient('you@org.com','password','org.crm4.dynamics.com',1);
$request = 'XML HERE'
echo $dynamicsClient->sendQuery($request);

Posted on August 7, 2011 by ben

A client had installed WordPress inside a subfolder but then had bought a domain she wished to use. However WordPress links were hardcoded to the old subfolder? Here’s the SQL queries that migrated it to the new domain.

UPDATE wp_posts SET guid = replace(guid,"oldsite.com/subfolder","newsite.com")
UPDATE wp_posts SET post_content = replace(post_content,"oldsite.com/subfolder","newsite.com")
UPDATE wp_options SET option_value = replace(option_value,"oldsite.com/subfolder","newsite.com")

Posted on August 3, 2011 by ben

Recently I was working on a Facebook app and I needed to grab a history of a users status updates. I found the Facebook API quite badly documented. This is the FQL code I used. You need to define $facebook with your app key and make sure your app has permissions to access users status updates.

$sql = "SELECT message,time FROM status WHERE uid = ".$uid;
$param  =   array(
	'method'    => 'fql.query',
	'query'     => $sql,
	'callback'  => ''
);
$fqlResult = $facebook->api($param);

Posted on July 17, 2011 by ben

I am currently working on a PHP script that will pass a large number of queries to the tvrage.com API and format the data in a jQuery sortable table. I will hopefully have a beta up soon. Its refreshing when such a large database of information has such an easy to use API.


Posted on June 6, 2011 by ben

I needed to extract some screenshots from a video file on Debian. I knew I could do this with FFmpeg but I wanted to take four every 20 mins so I wrote a quick script in bash.
The usage is ./sc.sh [filename] [number of screenshots to produce]

#!/bin/bash
file=$1
times=$2
x=1
while [ $x -le $times ];
do
ffmpeg -ss $(echo "$x * 1200" | bc -l) -i "$file" -an -vframes 1 -f image2 images$(echo "$x").png;
x=$(( $x + 1 ))
done

Posted on June 1, 2011 by ben

I fixed this a long time ago but its my first official advisory (Thanks s3rv3r_hack3r) so I am quite proud. Also my first lesson in input sanitization. Here’s the advisory in 2006 and here’s how I fixed it.

if (!get_magic_quotes_gpc()) {
	$file = addslashes($file);
}

Code

This is a listing of the various scripts and software projects I have created. Please use the menu to the left for more information.

All code is distributed under Creative Commons.

Sources are available on Github.

My Github Profile

Blog Script

Size: 8,894 bytes
ETA: 1.27 Seconds (at 5.6Kb/s)
License: Creative Commons
Downloads: 2631

I designed this blog system for the old threesquared.net. It allows blog posts from verified users and comments from visitors. The data is stored in a SQL database. The script includes an admin section to edit or remove blogs or comments.

Feel free to use this script and modify it. Please leave the credits in.

Download here | View Source

User Login Script

Size: 8,192 bytes
ETA: 1.3 Seconds (at 5.6Kb/s)
License: Creative Commons
Downloads: 13622

This login script is based on php session data and does not use cookies. It has the ability to let users register themselves. The user inputs their name, username, email, website and password. This data is then stored in a text file. Php sessions can be called on anywhere on your site, this means that you can include user information or block certain users, or just people who have not registered, from certain web pages.

Download here | View Source

Download Script

Size: 762 bytes
ETA: 0.11 Seconds (at 5.6Kb/s)
License: Creative Commons
Downloads: 6288

This is a simple download counting script. It uses text files and not mysql databases. The script simple adds one to a text file of the same name as the file wishing to be downloaded and then forwards the user to the file.

** Following a security advisory the script has been updated. Download revised script now and turn on the "magic_quotes_gpc" php option

Download here | View Source

Users online Script

Size: 1,010 bytes
ETA: 0.5 Seconds (at 5.6Kb/s)
License: Creative Commons
Downloads: 2258

Simple script to display how many users are browsing your website The script simply adds the user's ip and the time they entered your site to a text file. After a certain time the user is deleted unless they activate the script again.

Feel free to use this script and modify it. Please leave the credits in.

Download here | View Source

Link Script

Size: 8,894 bytes
ETA: 1.27 Seconds (at 5.6Kb/s)
License: Creative Commons
Downloads: 1444

Simple script to display a frame from your site on external links. The script opens your link in a frameset with a small frame the script also knows the page that the user came from and gives them the option to return. Usefull if the user wants to return to your website. The script also gives an option for the frame to be removed.

Feel free to use this script and modify it. Please leave the credits in.

Download here | View Source

Email form Script

Size: 8,894 bytes
ETA: 1.27 Seconds (at 5.6Kb/s)
License: Creative Commons
Downloads: 3301

Simple script to allow users on your website to send you an email. The script receives the subject and the address to send the message to it requires the user to input their name, email and their message then it sends the email.

Feel free to use this script and modify it. Please leave the credits in.

Download here | View Source

FFmpeg Screenshot Script

This is a bash script to extract screenshots at 20 minute intervals from video files using ffmpeg.
Usage: ./screenshot.sh [file] [number of screenshots]
#!/bin/bash
file=$1
times=$2
x=1
while [ $x -le $times ];
do
ffmpeg -ss $(echo "$x * 1200" | bc -l) -i "$file" -an -vframes 1 -f image2 images$(echo "$x").png;
x=$(( $x + 1 ))
done

Eggdrop RegEx Downloader

This is a TCL script for an Eggdrop bot to scan a channel and download any urls that match regular expressions.
package require http
bind pubm -|- "*" dller

proc dller {nick uhost hand chan text} {
        
        # Set your download dir here
        set watchdir "/home/path/to/download/dir"   
        # Put your regex patterns here
        set patterns(1) {^(Something|Else)\.*\.dll}
        set patterns(2) {^(Test)\.*\.exe}
        
        # Do not edit below here
        set line [stripcodes bcruag $text]
        
        foreach pattern [array names patterns] {
                if { [regexp $patterns($pattern) line] } {          
                        set token [::http::geturl $dll]         
                        set outfile [open $watchdir/$line w]
                        fconfigure $outfile -translation binary 
                        puts -nonewline $outfile [::http::data $token]
                        close $outfile                                  
                }
        }
}
putlog "Regex downloader by Ben Speakman loaded..."

Projects

These are various web projects I have worked on. Click on the images to find out more.

Locum Assistant

This website was created for Locum GP's. The brief was to provide a central website to store information that could be accessed from anywhere.

It features a document upload facility, practice database, contact database and a website database. It also pulls NICE Guidelines from the website and parses them for display. This is all achieved with PHP and MySQL.

You can visit it at
http://la.d-formed.net

Facebook App

The brief for this app was to be able to allow facebook users to submit their facebook status history for analysis and then compare it against the results of a psychological survey. This was to determine if facebook statuses are indicative of personality.

This involved using PHP regular expression matching data pulled from the Facebook API against words in a SQL database. The mean average was calculated to be compared against results of the surveys.

I undertook this in association with Thomas Johnson from Heythrop College as part of his dissertation.

Jusebox.tk

This is a website by Emil Smith. It is designed to bring content from various RSS feeds into a easy to use interface for casual internet users.

I was involved with the PHP RSS aggregation and parsing. I also contributed to some of the jQuery used in the interface.

You can visit it at
http://www.jusebox.tk

D-formed.net

This is the current design for d-formed.net. It had to be clean and easy to use whilst also displaying key information.

It also includes a script that reports on the status of the server and its services. This is achieved with querying /proc/ and interacting with SNMP.

You can visit it at
http://d-formed.net

Cottage Website

The brief for this website was to create a site showcasing a holiday house for rent in St Ives, Cornwall.

It features a booking system that generates the weeks in the year and marks which ones have been set as booked from a SQL database. There is an admin area for users to login and update this information.

Click here to view the design

Bluehell

The brief for this site was to create a homepage for an IRC network.

The site included my simple blog system to allow admins to update important network information. It also featured a system to query the available IRC servers to display which ones were currently online.

Click here to view the design
PHP Debian Valid CSS Valid XHTML