New Year & New Blog

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Sunday, 17 January 2010

It's 2010 and I feel it's time for a change so I'll be posting on my new blog at http://blog.johnantoni.com and tweeting addictively on twitter as usual.

I've made a few New Year's resolutions which with a bit of luck should stick to, and yes the book's finally underway; hope to finish that this year.

Come along and enjoy the ride,

Take care all :-)

Licensing for this Product has stopped working

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Monday, 21 December 2009

Thanks Adobe very much, I go out and buy your software because I'm obsessed with it's incredible features, and bingo you get slapped by an annoying error message you have no idea what it means.

Probably a lesson in user experience there.

Anyway short answer, on a MAC, is this:

Goto the Root of your System drive, then navigate up to...

/Library/Preferences/FLEXnet Publisher

And delete the folder, It'll destroy the FLEXnet service which for me was pretty broken, and when you fire up your Adobe package it'll re-init the Licensing Activation process.

FLEXnet by the way is the software Adobe uses to handle licensing for their packages.

Just wish someone would come up with a decent Illustrator alternative to Adobe's product's or at least give them a competitor.

Feck!

;-)

Deploy to iPhone

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Friday, 23 October 2009

Download the SDK

First off hit the Apple Developer Connection website and register for an iPhone Developer Account, you can download the iPhone SDK (weighing in at 2.3gb) without paying the $99 / £59 but if your going to develop for the iPhone and you've got one or an iTouch you might as well do the whole thing. The licence lasts 12 months after which you need to renew each year and you'll get all the cool beta kits.

Once you've registered, paid the money, downloaded the SDK and installed it let's move on.

Certificates

While on the site, you'll need to create your team, get your iPhone device ID registered, then generate your Development certificate and Distribution certificate; along with your provisioning profile files.

Once you've downloaded them, install the Key files (has the .cer extension) into your KeyChain (double-click the downloaded key files); should ask you for your user password to install them in.

Important bit next.

Apple WWDRCA file

Download the Apple World Wide Developer RCA file http://developer.apple.com/certificationauthority/AppleWWDRCA.cer and double-click that to add it to your KeyChain, this should turn your Developer & Distribution certificates green and active.

Check those Certificates

Fire up Keychain Access, select the Login keychain, and My Certificates; you should see your Developer & Distribution iPhone certificates, select them and they should show green ticks with This certificate is valid.

Make sure their trust level is Use System Defaults and they're in the Login keychain, either of these three things don't happen and you won't be able to deploy to your iPhone / iTouch device.

Provisioning Certificates

Another important stage, make sure your iPhone / iTouch is plugged in, fire up XCode and click Window / Organiser; here you'll be able to deploy your provisioning certificates to your device. Select IPhone Development / Provisioning Profiles and drop in your two profile files into here, select Devices and your device and in the central area you should see those two profiles now copied and embedded into your device.

Deploy

Next up with XCode running and your iPhone app built;

  • In the drop-down, select the Active SDK to IPhone Device
  • In the Groups & Files area, select Target, expand it and select your target file, hit the Info button
  • In the Properties tab, make sure your identifier is the same as your AppID, (e.g. com.myself.appname)
  • Select the Build tab and scroll down till you see Code Signing Identity and you should see your two active profiles (generated from your certificates + provisioning profiles)
  • Select the Developer one for now, close the dialog and hit Build and Run

This will now build your app and send it to your device.

If all goes well, put your feet up, you've just done one of the hardest tasks of IPhone app development; well done!

Enabling Snow Leopard 64-bit Kernel

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Friday, 23 October 2009

Amit Singh recently posted how to patch your macbook with the 64-bit kernel enabled, here i'll try to explain why you'd want to do this and guide you thru the process of making this happen.

Technicals

First off this article assumes you have a Snow Leopard installed on your macbook, and that it's one of the newer ones with the Intel Core 2 Duo processors. Core Duo's only support 32-bit mode, Core 2 Duo's have a 64-bit instruction-set and so are capable of running the 64-bit Kernel & 64-bit EFI; think of the EFI as your system bios done much better.

Why

Well the problem here is that when Snow Leopard came out, it heralded the age of a full 64-bit machine, efi, kernel, software, the works. However there was a problem, a lot of original intel mac hardware was only capable of 32-bit mode, so they had to make a decision, enable 64-bit mode and annoy particular users or leave it in-active and gradually ramp up the ones that could; thankfully they opted to allow all intel mac's access and then ramp up support as things progress.

Now newer hardware should come with the 64-bit kernel enabled, giving you faster throughput, and as everythings going that way you'd probably want to be there.

Now with my macbook, an aluminium unibody 13" Intel Core 2 Duo 2.0ghz macbook, I couldn't get the 64-bit kernel enabled, only the 64-bit EFI; however by patching the BOOT.EFI file managed to enable it.

How

To run the 64-bit kernel, you'll need:

  • Snow Leopard
  • Intel Core 2 Duo Mac
  • a 64-bit efi
  • and a patched boot.efi file

The patched file enables 64-bit kernel support for some macmini / macbook / imac / macbook-air models, which have the 64-bit efi bootrom.

Download the file to your desktop, open Terminal and:

cd ~/Desktop
sudo cp boot64.efi /System/Library/CoreServices/
cd /System/Library/CoreServices/
sudo chown root:wheel boot64.efi
sudo chflags uchg boot64.efi
sudo bless −−folder /System/Library/CoreServices/ \
−−file /System/Library/CoreServices/boot64.efi

Commands starting with sudo will ask for your password.

Next,

nano /Library/Preferences/SystemConfiguration/com.apple.Boot.plist 

And add arch=x86_64 to the Kernels Flags section, e.g.

<key>Kernel Flags</key>
<string>arch=x86_64</string>

Now reboot, your mac should boot up with the 64-bit kernel, but some models missing 64-bit intel video drivers, for example macbook4,1 with gmax3100 may not.

If something does go wrong, boot with the Leopard / Snow Leopard DVD and run this command in terminal

sudo bless –folder /Volumes/YOUVOLUMENAME/System/Library/CoreServices \
–file /Volumes/YOUVOLUMENAME/System/Library/CoreServices/boot.efi

How do I Tell ?

Open up System Profiler, click Software and you should see:

64-bit Kernel and Extensions:   Yes

Update - Problem with 10.6.1

Alas the recent OSX update 10.6.1 was sent out which looks to have made this whole process mute, even if you hard-wired the boot file. Obviously they didn't want certain machines running 64-bit mode after all. Thankfully as long as you aren't one of the lucky ones with more than 4GB RAM you won't notice it, 32-bit and 64-bit apps should run peachy regardless.

Enjoy, it was fun while it lasted.

Last flight of the Victor jet plane

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Sunday, 18 October 2009

At the Cold War Jets open day, at Bruntingthorpe. The Victor XM715 (aka 'Teasin Tina') had a short sortie to the bottom of Brunty's runway. One amazing sight, it brought back memories of air shows back in the 80's and 90's, no one was hurt, the Victor was ok and the crew were a little 'red faced', not bad for the ol' girl.

Courtesy of jetnoiseforever

Django 1.0 Web Development Review

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Wednesday, 14 October 2009

Django Web Development

Django development evolved

For a while now I've been itching to try out Django, it's one awesomely powerful framework, simple and elegant. So thanks to a good friend, Ayman Hourieh sent me a copy of his recent book "Django 1.0 Web Site Development" to review and boy is it a cracking read.

Don't over complicate

Unlike some other books I've read he doesn't try to tackle all the bases at once and then put together the pieces afterwards, he sets out a clearly defined roadmap at the start and builds upon each chapter as you progress; reinforcing what you've learnt with quick review sessions at the end of each chapter.

Starting small he introduces you to the world of Python, it's origins and how & why the Django framework was created. Ayman then runs you through a couple of example lessons to gain your experience with it's fundamentals. This is important as it increases your confidence with the framework and settles you into progressing more, and not pushing you too far too soon. Let's face it with anything new confidence is a big factor and it's important to not try to do too much or embellish too far with details that are little use, and Ayman nails it.

All are welcome

Python is one of those languages, like Ruby or PHP, that doesn't restrict you to a specific o/s and right away he shows you how easy it is to install and setup on Linux / OSX or Windows; you've got to love things like that, good stuff.

Structure

Once done we setup Django, create our first "hello world" project and then review what we've learnt before continuing. Next we go ahead and build a simple social bookmarking application (think of a simple Del.icio.us), we learn about Templates and building up our Database Schema; summarising as we progress.

Next up we handle User Registration. Django comes with a set of default packages which each provide a specific form of functionality to your app, authentication and user management is baked in, others like tagging can be installed as required; it's up to you to decide how you use them.

He bases each chapter on real-world processes, securing your app, tagging, expanding the data schema and adding AJAX functionality with the awesomely powerful jQuery framework. Building on social networking concepts he shows you how to add voting, sharing bookmarks between users and allowing those users to comment on each others posts; before you know it you've got a pretty sterling app going.

Admin and RSS

Next we delve inside Django's built-in administration interface, restricting users, group permissions and crafting the interface more to your application's liking.

We then look at advanced searching and adding RSS news feeds to our application, binding those to our users so each one has their own channel. By using Django's Q objects you can quickly gain a solid understanding of it's Database API and Ayman's examples are pretty easy to follow here.

Deploy

Once we've built a friendship model and an email system, Ayman shows us how to bake in internationalization. This is not a new concept if you've used other frameworks like Rails or CodeIgniter, but he lays it out so easily that the task of translating the phrases is the only headache you get; and being agile we don't get past deployment without putting together some fixtures and automated tests so we have confidence in what we're giving the public.

Conclusion

All in all, for $39.99 (24 quid), you get an easy to understand roadmap that teaches you a good set of fundamentals and takes you from a basic app to something really powerful. At a stretch you could probably complete the app in a week, after which Ayman gives some decent pointers for how to improve it. Weighing in at 250 pages it's perfectly balanced to give you the proper start in this awesome framework.

Great stuff, well recommended

naked urls on Google AppEngine

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Saturday, 12 September 2009

With the last post you've hopefully managed to get your App on AppEngine, next up getting http://www.myapp.com and http://myapp.com going to your AppEngine App

So while still in you Google AppEngine Control panel, goto Versions and click Add Domain

Here enter the domain name you've registered with Google Apps (e.g. myapp.com, without the www)

This will take you to your Google Apps login panel, login as normal and accept the Terms of Service for your AppEngine App to be integrated into your Google Apps account.

Next the url,

While in Google Apps, click on your new AppEngine area, and on Settings click Add New URL, enter www and click add

What about http://myapp.com naked links?

Well Google AppEngine have revised their policy on this so you can no longer point myapp.com to your app, you have to do this by creating a HTTP Redirection record with your DNS Registrar.

So, via DNSMadeEasy (my personal choice), login and on your domain records:

  • Add a CNAME for www pointing to ghs.google.com.
  • Add a HTTP Redirection record (permanent redirect 301) pointing to http://www.myapp.com with the host part blank

Wait an hour for your DNS registrar to update thru the web and www.myapp.com and myapp.com should now be pointing to the same place

Enjoy!

Sinatra on Google AppEngine

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Saturday, 12 September 2009

In an effort to try new things out I've always been tempted by Google's AppEngine service, it's free as long as you stay below the thresholds (which as long as it's not facebook v2 you should be ok).

So following Bigcurl's advice here goes...

JRuby

First download and build JRuby from Github

git clone git://github.com/jruby/jruby.git
cd ~/jruby
ant && ant jar-complete

Now check to see what version compiled

bin/jruby -v
=> jruby 1.4.0dev (ruby 1.8.7p174) (2009-09-12 6586) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_15) [x86_64-java]

Install your necessary gems

bin/jruby -S gem install rake sinatra warbler builder rack

Builder is required for xml generation (e.g. sitemap.xml)

JRuby-Rack

Next grab and build JRuby-Rack

cd ..
git clone git://github.com/nicksieger/jruby-rack.git
cd ~/jruby-rack
~/jruby/bin/jruby -S rake SKIP_SPECS=true

Convert Sinatra App

Now re-work your Sinatra app like...

/myapp
.../app.rb
.../config.ru
.../config/warble.rb
.../appengine-web.xml
.../lib
.../public
.../views

Use this gist as a template for your config.ru, app.rb, and appengine-web.xml, config/warble.rb files => http://gist.github.com/91801

Create your AppEngine & Name it

Next create your App in AppEngine, for me I did this via my Google Apps account...

Follow the steps and create your first app, you're allowed a maximum of 10, two points though...

  • Once you've created your app you CANNOT delete or rename it
  • Make sure you research the security options, once set you CANNOT revoke them

Once an App is deployed you can deactivate the deployment, but unfortunately you cannot delete it, so pick the names wisely.

Personally I use numeric identifiers for my AppEngine Apps, e.g. myapp1, myapp2, myapp3... that way you have a reference to them and they're not tied by name to a specific app, pretty much like savegame slots in an old GameBoy cartridge :-)

Test Your Sinatra App

Once you've copied the settings from that Gist, try out your Sinatra app...

ruby app.rb

Point your browser here to check it's running ok => http://0.0.0.0:4567

SDK

Next grab the AppEngine Java SDK from here

Download and extract it, then copy appengine-java-sdk-1.2.5/lib/user/appengine-api-1.0-sdk-1.2.5.jar to your App's lib directory

Next copy jruby-rack/target/jruby-rack-*.jar to your App's lib directory And copy jruby/lib/jruby-complete.jar to your App's lib directory

Or via Terminal...

~/jruby-rack/target/jruby-rack-*.jar ~/myapp/lib
~/jruby/lib/jruby-complete.jar ~/myapp/lib    

Split JRuby

AppEngine, being free, has a 1000 file-limit, so we'll need to do some trickery to get our app deployed.

Following Ola's GIST, create a file in your lib dir split.sh and copy the contents here into it:

#!/bin/sh

rm -rf jruby-core.jar
rm -rf ruby-stdlib.jar
rm -rf tmp_unpack
mkdir tmp_unpack
cd tmp_unpack
jar xf ../jruby-complete.jar
cd ..
mkdir jruby-core
mv tmp_unpack/org jruby-core/
mv tmp_unpack/com jruby-core/
mv tmp_unpack/jline jruby-core/
mv tmp_unpack/jay jruby-core/
mv tmp_unpack/jruby jruby-core/
cd jruby-core
jar cf ../jruby-core.jar .
cd ../tmp_unpack
jar cf ../ruby-stdlib.jar .
cd ..
rm -rf jruby-core
rm -rf tmp_unpack
rm -rf jruby-complete.jar

Run it

sh ~/myapp/lib/split.sh

Giving you your ruby-stdlib.jar file

Hold up, what about Builder ?

For my app, I'm using Builder to generate my sitemap.xml file, so edit config/warble.rb to add this in; along with require 'builder' in config.ru and app.rb

mate config/warble.rb

And include it...

config.gems = ['sinatra', 'builder']

Please continue...

Next pack your application for deployment

cd ~/myapp
~/jruby/bin/jruby -S warble

This should create a tmp folder and a .war file. Since AppEngine needs the exploded war folder and not the .war file, we simply ignore the file

Now edit sinatra.rb:

mate tmp/war/WEB-INF/gems/gems/sinatra-0.9.4/lib/sinatra.rb

And comment out the last like so...

# use_in_file_templates!

Test it Locally

Using the AppEngine SDK we downloaded, use it to test your app...

~/appengine-java-sdk-1.2.5/bin/dev_appserver.sh tmp/war

Point your browser to http://localhost:8080/ and as long as the console returns no errors you should be ok.

Deploy!

Copy your AppEngine's application-id into the appengine-web.xml file, replacing YOUR-APPLICATION-ID

mate appengine-web.xml

Once done, 'warble' your app to add the id to it,

~/jruby/bin/jruby -S warble

Now deploy,

~/appengine-java-sdk-1.2.5/bin/appcfg.sh update tmp/war/

The final app will probably weigh in at 96mb so on a standard ADSL connection will take approx 15-30 minutes to upload, during which you should see something like this:

Reading application configuration data...
2009-09-12 22:05:22.788::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
Beginning server interaction for myapp...
0% Creating staging directory
5% Scanning for jsp files.
20% Scanning files on local disk.
25% Scanned 250 files.
28% Initiating update.
Email: ----
Password ---- 
31% Cloning 46 static files.
33% Cloning 332 application files.
34% Cloned 100 files.
35% Cloned 200 files.
36% Cloned 300 files.
40% Uploading 142 files.
52% Uploaded 35 files.
61% Uploaded 70 files.
68% Uploaded 105 files.
73% Uploaded 140 files.
90% Deploying new version.
95% Will check again in 1 seconds
98% Will check again in 2 seconds
99% Closing update: new version is ready to start serving.
99% Uploading index definitions.

Update completed successfully.
Success.
Cleaning up temporary files...

Point your browser to http://myapp.blogspot.com and you should see your App, modify url accordingly :-)

URL Shortener

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Saturday, 22 August 2009

6

Seems everyone's doing something of the kind, so via Sinatra and some vendored gems here's a nice URL shortening tool.

Based off of Andrew Pilsch's fantastic work, you basically provide a URL and it'll return a shortened equivalent. When you click the link your browser redirects to assetboy.com with the code, recalls the related entry from the SQLite DB and redirects you to the original URL.

Hoping to put the finishing touches to the next tool I'll be releasing in September, a Domain-name availability tool called pingbunny.com, also powered by Sinatra; after which it'll be iPhone development.

Have a play, enjoy

assetboy.com

mod rewite + sqlite on joyent

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Thursday, 20 August 2009

Mod Rewrite

in your /web/public directory create your .htaccess file:

RewriteEngine On
RewriteRule ^$ index.html
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php

Give it a minute and all requests for www.mysite.com will point to index.php

Enabling Sqlite support on Joyent Shared Accelerators

Although this has been left out of the shared accelerators you can re-enable it.

Using Transmit, or any other SFTP tool, in your domain's site navigate to it's /etc/php5/php.ini

Now find the below and enable them, removing ;

extension=pdo_sqlite.so
extension=sqlite.so

Restart Apache or in VirtualMin go to Edit Virtual Server and hit Save Virtual Server to trigger a refresh.

In a minute your site should have SQLite3 support

OSX Screen Lock

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Thursday, 13 August 2009

Handy little tip courtesy of What Do I Know

  • Fire up the Keychain Access utility
  • Goto ...Preferences -> General
  • Tick "Show Status in Menu Bar"

An open Pad Lock will appear on your menubar window, now every time you need to lock your screen you can do so thru the Pad Lock

Nikon FM2 - Rewind / Reload / Settings

  • Digg this article
  • Sphinn this article
  • Stumble this article
  • Facebook
  • del.icio.us
  • LinkedIn
  • Twit this article

Sunday, 09 August 2009

3

Rewind

Simple to do:
  • Press silver button in on bottom of camera
  • Then on the crank, turn it in the direction of the arrow clockwise
  • You should feel the film turn as you wind it, after which there'll be a satisfactory click as all the film is wound back.
Don'ts
  • Don't turn the crank BEFORE you press the button below, you'll rip the film out of it's case and destroy it
  • Don't pull the plastic latch below the crank, that allows you to pop the back out and replace the film

Reload

The film shouldn't take too long to rewind, after which you CAN pull plastic latch below the crank, pull the crank up and the back will pop open allowing you to take out the film.

Place the new reel in the back, pull the film along so it catches the clasp and rotate once to get a grip. Pop the back on and you're ready to go.

Settings

Light settings that seem to work:

Cloudy Sky:
    f/5.6, 1/250s, ISO 200

Inside:
    f/2.8, 1/15s, ISO 400

Museum:
    f/5.6, 1/60s, ISO 200

There's a good iPhone app called PhotoBuddy that can help you, if you've got one of the new 3GS models you can download it's more advanced cousin Light Meter to calculate timings better.

More info here

Enjoy