Quake 2 Lithium 16-Bit Retro Chic

Many many moons ago when my Voodoo 3DFX card was the height of PC chic. I had my first Multiplayer FPS experience with Quake2.  Up until that point, multiplayer gaming meant playing red alert with a friend and a rather shonky serial cross over cable.  Many hours were waisted and many many MB’s of space taken up with extra maps and models.  Models that almost instantly got banned due to being impossible to see, and effectively making you invisible to your opponents.  And many frags were clocked up whilst grappling madly around the map with the Lithium MOD. Fun was had by all then we moved on to newer games with slightly higher resolutions and slightly better textures, that were never quite as much fun as the original Quake 2 Lithuim experience.

Well <Farnsworth>Good News Everybody</Farnsworth> as is the current trend to revive all those 8-bit games, now is the time to relive the 16-bit age, after all the only decent thing to come out 8-bit was Gauntlet 2. Where this rather inarticulate ramble is going is that Quake 2 Lithium has been reborn at Quake2Lithium.com.

And im currently involved in building a statistics engine for the scene based on a V2 of the q2stats that myself and Darren built in 2008. They can be found at q2stats.com

Posted in Gaming | Tagged , | Leave a comment

Php AD Search

Have rewritten my adsearch script to have more bells and whistles.  Have started to document it and download available here

AD Search V0.11

Posted in phpadadmin | Tagged , , | 1 Comment

themoviedb.org PHP class

This class I have written has been some time in the making, its currently the whats powering the alpha version of 2statereviews V2.    Things it will do for you:

  • Will pull down Actor or Movie information from themoviedb.org using the API (currently defaults to V2.1) and sort info into an array i.e.
    • $tmdb->movie_info(’11′);
    • $tmdb->actor_info(’738′);
  • Will pull down Actor or Movie Searches into an Array
    • $tmdb->actor_search(‘John Cussack’);
    • $tmdb->movie_search(‘the empire strikes back’);
  • will cache the output from themoviedb.org locally with a configurable TTL so as to speed things up.

Some examples have been provided.

Note: you’ll need to provide your own API key.

Download V1 here

Posted in Techy Stuff | 2 Comments

Iphone Restore 1604 Error

1604 error

Iphone Restore EPIC FAIL!

Past couple of days have been a slight horror, when I rebooted my Iphone and it didn’t come back. Just sat stuck on the Apple logo, with spinner on top not spinning. So I went through an horrific day without my phone. That night I frantically tried to restore the firmware 3.1.2, I kept getting the 1604 Error. Reading online there is lots of talk about deleting or moving your Iphone profile from the app settings directory, none of these solutions worked for me including the tool Ireb. I tried several USB leads, having had one previously fail, but still nothing.

Solution for me was to use another machine windows 7 this time, was previously trying on XP, and It worked first time. Can only assume this is some very picky code in the usb communication.

Posted in Techy Stuff | Leave a comment

Re Twitter your twitter feed

knocked up a quick function to put the links back into my twitter feed, after i pull it down using their API.

it will take the text you input and create links around the @<username> #Hashtags and any links i.e.  twitpic’s etc.  Not rocket science but could save you 30minutes of trying to get your head around regex again.

function _twittertext($tweets) {
$tweets = preg_replace('/http:\/\/([\\d\\w.\/]+)/', '<a href="http://$1">http://$1</a>', $tweets);
$tweets = preg_replace('#@([\\d\\w]+)#', '<a href="http://twitter.com/$1">$0</a>', $tweets);
$tweets = preg_replace('/#([\\d\\w]+)/', '<a href="http://twitter.com/#search?q=%23$1">$0</a>', $tweets);
return $tweets;
}

Posted in Techy Stuff | Tagged , , | Leave a comment

My XBMC Multi Room audio challenge.

Recently I have successfully migrated away from SKY HD and from Freeview+ to an entirely XBMC based solution.  Most importantly this solution currently has a very high WAF .  My setup is built using XBMC live in an overly powerful PC in a rather nice silverstone media center case.

My current problem is now I have relegated all of my media to the lounge,  using the ipod dock in the kitchen with a meagre 16GB Ipod seems positively lacking when, your media centre is connected directly to a 5Tb NAS.  What happens now is you play music in the lounge and turn it way up to a probably neighbour unsuitable level to be able to properly enjoy it in the kitchen.  This is why I crave multi room audio, I wrote a while back why I think XBMC is a far better and cheaper solution than the Sonos solution, though Sonos still do have the killer feature present and correct. Continue reading

Posted in Media Centre | Tagged , , , | 7 Comments

XBMC Gmail notifications.

I have this php script currently running on my nas to let me know if I have any new mail.  It works with gmail.com, googlemail.com and google app address’.  I simply use cron to execute the script every 15 minutes.

i.e. (0,15,30,45 17-23 * * * php /var/www/checkgmail.php > /dev/null   #Check Gmail)

   1: <?php

   2: $emailaddress = 'someemailaddress@gmail.com'; // i.e. bob@gmail.com or bob@bobsdomain.com if you use google apps

   3: $password = 'somepassword'; // email password

   4: $xbmcaddress = '192.168.1.1'; // IP or hostname of your xbmc

   5: $xbmcport = '8080'; // port the xbmc web server is running on.

   6:

   7:

   8: $domain = explode('@',$emailaddress);

   9: if ($domain['1'] == 'gmail.com' || $domain['1'] == 'googlemail.com')

  10:     {

  11:     $use_googleapps = false;

  12:     } else {

  13:     $use_googleapps = true;

  14:     }

  15: if ($use_googleapps == true)

  16:     {

  17:     $url = 'https://mail.google.com/a/'.$domain['1'].'/feed/atom';

  18:     } else {

  19:     $url = 'https://mail.google.com/mail/feed/atom';

  20:     }

  21:

  22:

  23:     $ch = curl_init ($url);

  24:     curl_setopt($ch, CURLOPT_HEADER, 0);

  25:     curl_setopt($ch, CURLOPT_PROTOCOLS,CURLPROTO_HTTPS);

  26:     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

  27:     curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);

  28:     $curllogin = $emailaddress.':'.$password;

  29:     curl_setopt($ch, CURLOPT_USERPWD,$curllogin);

  30:     $rawdata=curl_exec($ch);

  31:     curl_close ($ch);

  32:

  33: $array = xml2array($rawdata);

  34: $array = $array['feed'];

  35: //print_r($array);

  36:

  37: if ($array['fullcount'] < 1)

  38:     {

  39:     echo ' no new mail ';

  40:     } else {

  41:     if ($array['fullcount'] == 1)

  42:         {

  43:         fopen("http://".$xbmcaddress.":".$xbmcport."/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(".$emailaddress.",You%20Have%20A%20New%20Email!))",r);

  44:         } else {

  45:         fopen("http://".$xbmcaddress.":".$xbmcport."/xbmcCmds/xbmcHttp?command=ExecBuiltIn(Notification(".$emailaddress.".",You%20Have%20".$array['fullcount']."%20New%20Emails!))",r);

  46:         }

  47:

  48:

  49:     }

  50:

  51:

  52:

  53: function xml2array($contents, $get_attributes=1, $priority = 'tag') {

  54:     if(!$contents) return array();

  55:

  56:     if(!function_exists('xml_parser_create')) {

  57:         //print "'xml_parser_create()' function not found!"; 

  58:         return array();

  59:     }

  60:

  61:     //Get the XML parser of PHP - PHP must have this module for the parser to work

  62:     $parser = xml_parser_create('');

  63:     xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8"); # http://minutillo.com/steve/weblog/2004/6/17/php-xml-and-character-encodings-a-tale-of-sadness-rage-and-data-loss 

  64:     xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);

  65:     xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);

  66:     xml_parse_into_struct($parser, trim($contents), $xml_values);

  67:     xml_parser_free($parser);

  68:

  69:     if(!$xml_values) return;//Hmm...

  70:

  71:     //Initializations

  72:     $xml_array = array();

  73:     $parents = array();

  74:     $opened_tags = array();

  75:     $arr = array();

  76:

  77:     $current = &$xml_array; //Refference

  78:

  79:     //Go through the tags.

  80:     $repeated_tag_index = array();//Multiple tags with same name will be turned into an array

  81:     foreach($xml_values as $data) {

  82:         unset($attributes,$value);//Remove existing values, or there will be trouble

  83:

  84:         //This command will extract these variables into the foreach scope

  85:         // tag(string), type(string), level(int), attributes(array).

  86:         extract($data);//We could use the array by itself, but this cooler.

  87:

  88:         $result = array();

  89:         $attributes_data = array();

  90:

  91:         if(isset($value)) {

  92:             if($priority == 'tag') $result = $value;

  93:             else $result['value'] = $value; //Put the value in a assoc array if we are in the 'Attribute' mode

  94:         }

  95:

  96:         //Set the attributes too.

  97:         if(isset($attributes) and $get_attributes) {

  98:             foreach($attributes as $attr => $val) {

  99:                 if($priority == 'tag') $attributes_data[$attr] = $val;

 100:                 else $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'

 101:             }

 102:         }

 103:

 104:         //See tag status and do the needed.

 105:         if($type == "open") {//The starting of the tag '<tag>' 

 106:             $parent[$level-1] = &$current;

 107:             if(!is_array($current) or (!in_array($tag, array_keys($current)))) { //Insert New tag

 108:                 $current[$tag] = $result;

 109:                 if($attributes_data) $current[$tag. '_attr'] = $attributes_data;

 110:                 $repeated_tag_index[$tag.'_'.$level] = 1;

 111:

 112:                 $current = &$current[$tag];

 113:

 114:             } else { //There was another element with the same tag name

 115:

 116:                 if(isset($current[$tag][0])) {//If there is a 0th element it is already an array

 117:                     $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;

 118:                     $repeated_tag_index[$tag.'_'.$level]++;

 119:                 } else {//This section will make the value an array if multiple tags with the same name appear together

 120:                     $current[$tag] = array($current[$tag],$result);//This will combine the existing item and the new item together to make an array

 121:                     $repeated_tag_index[$tag.'_'.$level] = 2;

 122:

 123:                     if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well

 124:                         $current[$tag]['0_attr'] = $current[$tag.'_attr'];

 125:                         unset($current[$tag.'_attr']);

 126:                     }

 127:

 128:                 }

 129:                 $last_item_index = $repeated_tag_index[$tag.'_'.$level]-1;

 130:                 $current = &$current[$tag][$last_item_index];

 131:             }

 132:

 133:         } elseif($type == "complete") { //Tags that ends in 1 line '<tag />' 

 134:             //See if the key is already taken. 

 135:             if(!isset($current[$tag])) { //New Key 

 136:                 $current[$tag] = $result;

 137:                 $repeated_tag_index[$tag.'_'.$level] = 1;

 138:                 if($priority == 'tag' and $attributes_data) $current[$tag. '_attr'] = $attributes_data;

 139:

 140:             } else { //If taken, put all things inside a list(array) 

 141:                 if(isset($current[$tag][0]) and is_array($current[$tag])) {//If it is already an array... 

 142:

 143:                     // ...push the new element into that array. 

 144:                     $current[$tag][$repeated_tag_index[$tag.'_'.$level]] = $result;

 145:

 146:                     if($priority == 'tag' and $get_attributes and $attributes_data) {

 147:                         $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;

 148:                     }

 149:                     $repeated_tag_index[$tag.'_'.$level]++;

 150:

 151:                 } else { //If it is not an array... 

 152:                     $current[$tag] = array($current[$tag],$result); //...Make it an array using using the existing value and the new value 

 153:                     $repeated_tag_index[$tag.'_'.$level] = 1;

 154:                     if($priority == 'tag' and $get_attributes) {

 155:                         if(isset($current[$tag.'_attr'])) { //The attribute of the last(0th) tag must be moved as well 

 156:

 157:                             $current[$tag]['0_attr'] = $current[$tag.'_attr'];

 158:                             unset($current[$tag.'_attr']);

 159:                         }

 160:

 161:                         if($attributes_data) {

 162:                             $current[$tag][$repeated_tag_index[$tag.'_'.$level] . '_attr'] = $attributes_data;

 163:                         }

 164:                     }

 165:                     $repeated_tag_index[$tag.'_'.$level]++; //0 and 1 index is already taken 

 166:                 }

 167:             }

 168:

 169:         } elseif($type == 'close') { //End of tag '</tag>' 

 170:             $current = &$parent[$level-1];

 171:         }

 172:     }

 173:

 174:     return($xml_array);

 175: }

 176: ?>

Posted in Techy Stuff | Tagged , , , | Leave a comment

Iphone 2g MMS on BT Total Broadband Anywhere

MMS Enable your 2g Iphone

MMS Enable your 2g Iphone

I have succesfully got MMS working on my Iphone 2g with BT Total Broadband anywhere / BTMobile, and have solved the problem where the mms APN settings do not save. Continue reading

Posted in Apple Mac, Techy Stuff | Tagged , , , | 5 Comments

Using Gmail as a Sendmail Relay

The revenge this time its personal!

K I just setup sendmail to relay using gmail again,  thought I better post what I have done as my original now out of date post is still getting quite a lot of views.

This is based on my Ubuntu 8.10 Server ( 2.6.27-11-server) all patched up todays date and then I did the below. Continue reading

Posted in Techy Stuff | Tagged , , | 27 Comments

2statereviews.com

Im Currently spending all my spare spare time,  building 2statereviews.com with Darren Watt.  The site is based on Darrens long time Film reccomendation system which has only 2 states See! or Dont See!.   Simplicity at its best, the site allows you to search for films and vote See, Dont See for them, warning though its quite addictive.    The site is currently 80% feature complete ( this figure changes constantly as I make up new features).

alpha-invite

Posted in My Projects | Tagged , , , | Leave a comment