Archive for the ‘General’ Category

Moved over to Linode from Slicehost

Posted by rich on December 21st, 2008 categorised as General | 4 Comments »

Last night and the night before I went though the simple process of moving my websites over from slicehost to Linode. The moved went smoothly and I’m happy with the new provider.

I had been with slicehost for over a year now and they’ve provided a fantastic service, only ever had my VPS go down once due to a faulty server box I was on. Slicehost have a really nice clean control panel too which was very easy on the eye and simple to manage.

However, all of slicehost’s packages are for 64bit systems - no 32bit option offered. I’ve been looking to head back to 32bit to cut down on the memory consumption in a couple of Merb applications (as you know pointers are 64bit on a 64bit OS and Ruby makes use of pointers quite often). Linode allow you to choose 32bit and because of this I have managed to take my total memory usage of around 420mb down to 218mb with room to breath which has allowed me to drop down to a cheaper package, at least for now.

Linode so far have also been fantastic. The Linode control is a little more ‘full’ than the Slicehost one but after a few minutes of getting to know your way round it’s soon manageable and dare I say nicer, in the way it makes you feel like you’re in ‘more control’ over your server. Linode servers also felt a fair bit quicker, installing stuff seemed snappier and it feels like I get less delay when connecting via SSH - this could be down to the fact I was given a choice of data center and opted for one on the east coast.

On a side note, Linode also offer slighty higher memory, bandwidth and disc space for the same price that slicehost do. For example on the base package of $20 gets you 256mb ram, 100GB monthly bandwidth and 10GB of disc storage with Slicehost compared to the 360mb ram, 200GB bandwidth and 12GB storage you get with Linode.

Conclusion

So in conclusion I would highly recommend both hosts, I can’t comment on Linode up-time wise but so far they’ve been amazing had my slice within minutes of buying, the server seem quick lots of configuration options right down to which data center you wish to be placed into. Slicehost have been fantastic up-time wise the control is sleek and the packages reasonable.

I would personally recommend Linode if you’re trying to save a bit of cash and would like the 32bit option to get that little bit extra memory saving.

Come back in focus again

Posted by rich on May 15th, 2008 categorised as General | No Comments »

Off to see Kerry at aber this weekend so thought I’d pump out a quick youtube Friday before I head off.

First off I thought I’d start with the Floyd, this is from division bell, which is one of my favourite Pink Floyd album.

Next up a bit of Thom, not to sure if I’ve posted this before - I have yet to import posts from the old blog. I’m sure you can survive having to watch it again…..after all it is Thom :)

Finally I thought I’d post this video I found, I was orginally going to find Bob’s version, and then the one thats playing at the end of the last season of Battlestar Galactica but instead I found this insane child playing it like a pro. Enjoy (All along the watch tower btw).

Tinymce Syntaxhighlighter Plugin

Posted by rich on April 7th, 2008 categorised as General, Projects | 13 Comments »

I went to intergrate Syntaxhighlighter into the site tonight, something I’d forgotten to do in the redesign and I thought it would be nice if I could just click a button in tinymce and paste in the code, select a few options and click insert. Which of course is entirely possible so I’ve written a tinymce plugin to do just that.

I did encounter one little bug writing the plugin. When inserting the pasted code it keept repeating itself if there was currently no content in the body of the textarea (tinymce). I finally managed to fix it by putting a space at the end of the variable I was trying to insert (and with the power of highlighting here’s what that looked like).

textarea_output += '</textarea> '; /* Note space */
tinyMCEPopup.editor.execCommand('mceInsertContent', false, textarea_output);

You can download the plugin here:

  syntaxhl.rar (5.1 KiB, 245 hits)
  syntaxhl.tar.gz (4.6 KiB, 252 hits)
  syntaxhl.zip (5.7 KiB, 284 hits)

UPDATE: The project has been moved to github, this is the preferred way of obtaining the files. I will leave the old download links up for now. Also feel free to fork, modify and send pull request with changes to the project… improvements are always welcome.

http://github.com/RichGuk/syntaxhl/tree/master

Getting it to work

First you need to download Syntaxhighlighter and get that working by including the CSS file and Javascript files. I combind all of the syntaxhighlighter javascript files into one on 27smiles, you can get it here.

Extract the plugin

Next you need to extract the plugin to your tinymce plugin directory. When extracted it should be something like this:
/path/to/tinymce/plugins/syntaxhl

Configure tinymce

Finally we need to configure tinymce to use our plugin we also need to stop tinymce from stripping out <textarea></textarea> html tags as this is needed for Syntaxhighlighter.

tinyMCE.init({
theme : "advanced",
plugins : "syntaxhl",
theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor,styleselect,removeformat,cleanup,code, syntaxhl",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
remove_linebreaks : false,
extended_valid_elements : "textarea[cols|rows|disabled|name|readonly|class]"
});

We tell tinymce to use our plugin by adding syntaxhl to the plugins list and also adding the sytnaxhl button to the buttons list also note that extended_valid_elements contains the textarea tag this tells tinymce to not remove it.

If all went well you should see a new highlighter icon button in tinymce and when you click it you should get a dialog popup allowing you to insert code into your content.

If you encounter any bugs or have any problems getting it to work please contact me I’d be happy to help/fix bugs. Please note that I’ve only briefly tested this on Safari/IE7/Firefox 2/Firefox 3b5 and a quick blast on IE6 and from first tests it seemed to work. Also I was unsure if you have to stick to any standards when writing plugin’s for tinymce so it might not be the correctly way of doing it.

New Site and the holiday

Posted by rich on April 2nd, 2008 categorised as General | No Comments »

New website

I’ve finally fixed the website, from that file I
deleted. True it wouldn’t of required
that much effort to fix but I thought I’d give the site a re-code/design while I was at it
- I seem to have a habit of that but anyhow since I’ve improved on my Rails skills since the last code this build went much smoother which leads nicely into the next change. The layout.

I’m
sure you have noticed the new layout but I bet you did know that it in
fact changes between a night theme and a day theme at 6AM or 6PM….
but if you prefer one theme over the other why not click one of those
little icons in the top right? They change the theme to whatever one
you choose for that session (while the browser is open) you can even
switch back to the time based theme if you prefer that.

You’ll also notice the flickr, twitter and last.fm
integration on the right of the page. Apart from twitter they are all pulled in from an RSS feed and then using fragment caching with memcache in rails to do
some time based caching so the flickr feed is updated every hour and the last.fm one every 5 minutes. I will talk more about how I did this in a later post.

The twitter feed is updated/imported using their javascript code so that should be real time. Oh and about twitter I’ve finally decided I’d get one after months of thinking hmmm is there much point in telling people what I’m doing all the time? Well I thought meh why not? People don’t have to read it and its something all the ‘cool’ kids are doing.

Holiday

So for the past two week I’ve had some time off work and was lucky enough to spend 5 days in Edinburgh and 3 days in London with my girl friend (Kerry). Both trips went smoothly and a I thoroughly enjoyed both (I even enjoyed London :o).

National Portrait Gallary (Edinburgh)Edinburgh is both amazing and beautiful me and Kerry had a fantastic time here looking around both the city, art galleries and museums of which there are lots! We took a Flybe flight up to Edinburgh from Birmingham on a small plane which was nice. When we arrived in Edinburgh they had a very handy and excellent bus service from the airport which took us all the way into the centre, the buses run every 10 minutes - I really did think this was excellent. We stopped in the Royal Garden Apartments which was a very nice apartment. The apartment was but 5 minute walk from Prince’s Street and any shops we needed also being close to most of the attractions. Oh and the national portrait gallery was right opposite the apartment so of course we went there first =) (left image was view from the window).

Part of Edinburgh Castle

On the second day we went to Edinburgh castle, although I’d been before I was quite young so I only remembered bits so going again was a very fun day out, it also meant I got to take lots of pictures and blend in with all the cute Japanese tourists taking all their pictures. The castle was quite busy as you expect though there were a lot of school trips there with all these Scottish kids, I love the Scottish accent its cute.

On the third day we decided to visit all the galleries - national, modern, etc… these were spread all over the city so it took all day to get around. They were quite interesting but I’m sure Kerry enjoyed/appreciated them more so than I.

On the fourth day we went to the Museum of Scotland and the Royal Museum, which are attached, these were both very interesting and fun :), while being quite big and hard to navigate around at the same time.

Edinburgh

London Art GallaryThe 3 days we spent in London were very fun too, again we visited the art gallery and the natural history museum which were both very big and full of interesting paintings and animals the real excitement of course for me was the science museum :D getting to play with all the interactive stuff like a little child, amazing amounts fun indeed. Although we did get evacuated from the building for some reason, and I’d love to know why lucky for us though we were in the last room.

London Natural HistoryThe tube was not to bad at all, we found our way around with ease and although it got a little busy now and then majority of the time it was pretty empty. Also for some strange reason unbeknown to me I like the smell at the tube station, must be all that unclean air plus the tube kinda reminds me of the 60’s, maybe its because the icon looks all retro.

So all in all the holiday’s went very well and I enjoyed both lots and lots, although going back to work was a shock to the system.