content top

Spam on Mark Zuckerberg’s Facebook Page?

A day after Facebook launched it’s new ‘Subscribe’ (poor choice of name, too geeky) feature, allowing anyone to effectively follow anyone’s public posts, I noticed this on Zuckerberg’s facebook page. His page has been spammed by someone posting links to their youtube page…

 

Leave a Reply...

Passenger PrefPane 1.5 for Mac OS X Lion 10.7

If you’re having trouble getting the passenger preference pane to run under mac os x lion, that’s because it needs to be rebuilt using XCode. I’ve built it and offered a download below to save you the hassle:

Download Passenger.prefPane Lion 10.7

  1. Thanks, I’ll give this a go!

  2. All I get when I add a site to the pref pane it says ” It Works!” any ideas?

  3. Do you use redmine under OS X with passenger or straight ruby/rails? I have some difficulty with redmine under Lion server :)

  4. And how did you build it? I have an intel based Mac and your build does not work. So I want to build it on my own. Can you help me?

Leave a Reply...

What is Cloud? Just a word.

What is Cloud? Just a word.

I was in a meeting with Ciscos China GM for Datacenter Virtualization, Charleston Sin last week and he asked the same billion dollar question everyone’s been asking in China and worldwide recently: “How big do you think the Cloud Market will become?”, adding, “HQ is always asking for our numbers.” He’s not alone, analysts and technology leaders all over the world are asking and being asked this question. The problem for us all is what exactly does this question mean, or more specifically, what does Cloud Market mean?

I remember when I was working on my web startup in 2007 the global web community was engaged in excitement and fierce debate about Web 2.0 and what it meant. Web 2.0 was going to change everything, all new websites were ‘Web 2.0 enabled’, and investors were going crazy about Web 2.0 startups. Web 2.0 started when browsers got more powerful, javascript and html aquired new functionality, new server side scripting technologies became easier to use, and we learned how to scale web apps horizontally to provide applications that could support massive user bases and storage capacities. Flickr, Facebook, Youtube, and hundreds more websites like them emerged. They were the pioneers of what the analysts began calling ‘Web 2.0′. For a while every new website called itself ‘Web 2.0′ and even the corporate world of enterprise started trying to work out how they could use ‘Web 2.0′.

The same thing is happening with green. Governments and people around the world recognised the importance of saving energy and cutting carbon. A lot of technologies and businesses emerged as a result of reduced technology costs. In China, for example, there was a boom of solar panel producers. Now, everything that saves 1% energy cost or 2% carbon can be called ‘green’. Green doesn’t mean anything any more, it is simply a trend.

Let’s take a look at what is happening in these cases.

 

 

At the beginning in the red circle new technologies emerge, and start to become cost effective for businesses to adopt. Next in the green, businesses start adopting these technologies more agressively, they become integrated together, new paradigms emerge and people find new ways to innovate and use the technology. In the purple, the analysts, companies like Gartner and IDC, identify these emerging trends and give them a name. Finally, in the blue, the marketing departments of companies grab the name and go crazy with it, as the whole world of technology explodes in excitement about this new trend.

Above we see some of the technologies and trends that have lead to the explosion of cloud. However I believe what has happened in Cloud is that marketing people now use the word ‘cloud’ to define not one, but a very general and unspecific set of different trends, such as virtualization, on-demand IT, desktop virtual desktops, and big data. Technology reporter and friend Navin Kabra from Pune, India, writes in his recent article about Apple’s iCloud ‘…by now the term “Cloud Computing” or “Cloud” has become so diluted as to be essentially meaningless.’ His point is a valid one. Cloud now describes so many different trends that even the IDC and US government’s formal definitions of Cloud don’t really help any more. It is not important to argue about what Cloud is, but instead to recognise and accept that it covers a number of different trends.

Soon we are going to stop being interested in using Cloud as an ‘umbrella term’ for a number of technologies, applications and trends, in the same way ‘Web 2.0’ is no longer a popular or useful tech term. We can begin now, by using more specific terms such as IaaS, PaaS, and SaaS to describe what we really mean. However these three alone are not enough to cover all the new ‘Cloud’ technologies which are emerging. For example, is Apple’s iCloud ‘IaaS, PaaS, or SaaS’? Clearly it’s not IaaS or SaaS, and it’s not really a full platform either, it’s more like a storage platform or ‘Sync-as-a-Service’, a new dimension in the cloud game. And what about other services such as backup and voice as a service? These will soon be offered entirely as an elastic service: ‘Backup-as-a-Service’, ‘Voice-as-Service’.

 

_

 

Gartner has a well known ‘hype cycle’ curve which currently has Cloud perched neatly on top, ready for downfall. Does this mean the market will dry up and suddenly there will be no demand for IaaS – enabling technology, SaaS, Cloud Sync, big data, and other so-called cloud technology? Unlikely, I think, instead it will signal the end of the hype, and time for meaningful words, business models and technologies to emerge and grow strongly from 2012  through 2020. So perhaps we can start re-thinking how we use the word ‘Cloud’ now and stop trying to answer impossible questions like ‘What is Cloud Computing?’.

Now we can return to Charleston’s billion dollar question: “How big will the Cloud Market become?” and turn it into a meaningful one for his organisation, like: “How will trends in IT-as-a-service drive network equipment growth?”. With specific questions like this we can create meaningful answers which help build solid intelligence.

Questions such as ‘How big is Cloud?’ and ‘What is Cloud?’ are now only really useful from a marketing standpoint. Engineers and business leaders need to stay focussed and define what these cloud trends and technoligies really mean to their business, and how they can take advantage of them. The age of cloud hype is coming to an end, the real work is beginning, and businesses need to decide where to focus. The key is not to pay too much attention to the purple and blue circles in the diagram which represent the trends, hype and marketing terms of technology, and instead to keep focussed on the real benefits and applications of those technologies. Only in this way can businesses that want to take advantage of this paradigm shift in IT succeed. Next time someone asks you ‘What is Cloud?’, rather than confuse them with your own interpretation of Cloud, perhaps you can engage them with this answer: “First tell me about what your business does, tell me how you use information and technology, and I’ll tell how cloud computing can benefit you.”

Leave a Reply...

How to use Google Calendar to sync all your devices (iPad, iPhone, Mac)

It should be possible, it should be easy. You have two or three devices with two or more calendars and want to keep everything in sync, have an online calendar view, and be able to share calendars with family and colleagues while having them automatically update whenever a change is made. Now at least it is possible, if not easy.

In this guide we will look at how to use Google calendar and its CALdav support to link all your Apple devices and calendar.google.com with full, instant syncing between them all whenever you make a change. No waiting to sync in iTunes or putting up with read online calendar subscriptions!

1. Create a new account at http://calendar.google.com.

2. If you have iCal on your Mac you can easily sync this new google account, by simply going to Preferences -> Add Account -> Google Account -> Put in your details. All your calendars in your account will appear as ‘delegates’ which is kind of the CALdav equivalent of sub calendars. It looks a but strange in the iCal interface but it works. You can even copy events from your existing computer calendars en mass into your new synced calendar. They will instantly sync and you can view them on calendar.google.com

3. iPhone and iPad syncing primary calendar (the first one).

* Remove all existing google calendars from your iDevice, including unchecking any ‘sync calendar’ checks in your Google Account. Also make sure NO calendars are set to sync with your iDevice using iTunes. Go to iTunes and uncheck all calendar syncing to removed synced calendars. This is to avoid confusion later.

* On your iDevice go to Settings -> Mail, Calendars -> Add Account -> Other -> Add CALdav Account

* Fill in the following information:

Server: www.google.com

Username: <youremail@email.com>

Password: <your password>

Description: <your calendar name>

* Click ‘Next’. Now you have added your primary calendar.

4. iPhone and iPad syncing second, third, fourth etc calendars. If you already have just one calendar set up and you are happy with syncing only one of your calendars, you don’t need this guide. If you would like to sync multiple calendars on your account, not just one, read on…

CALENDAR LIST

CLICK A CALENDAR (FROM 2ND ON) TO REVEAL SETTINGS

* Go into your google calendar account -> Calendar Settings -> Calendars. Click on a Calendar and then locate the Calendar’s ID in the settings. Compose a new to yourself email with the calendar addresses like made up in a list this:

Projects Calendar

https://www.google.com:443/calendar/dav/INSERT_ID_HERE@group.calendar.google.com/user

Travel Calendar

https://www.google.com:443/calendar/dav/INSERT_ID_HERE@group.calendar.google.com/user


* Send the email to yourself with each of your calendars (2nd onwards) listed with their names as above.

* On your iDevice open the email you just sent to yourself, select the full address for the first calendar in the list, and ‘Copy’ it.

* On your iDevice go to Settings -> Mail, Calendars -> Add Account -> Other -> Add CALdav Account

* Fill in the following information:

Server: www.google.com

Username: <youremail@email.com>

Password: LEAVE PASSWORD BLANK

Description: <your calendar name>

* Click ‘Next’. It try to connect then fail. This is good, because now we see new ‘Advanced Settings’ option appear below. Click ‘Advanced Settings’.

* Select the whole calendar address and ‘Paste’ the address you copied from the email you sent yourself.

* Return to the calendar settings and enter your correct password. Click ‘save’.

* Repeat for all the calendars in your Google account.

You can follow the above steps for both iPad and iPhone, the settings are the same (Oct 2010).

  1. it works! nice, thank you

Leave a Reply...

Increasing max media upload size for WordPress

NOTE: This post covers one particular method of increasing the upload size, and php servers often have other methods of activating a custom php.ini file. This method works on Site 5 shared hosting. We are going to create a custom php.ini file and activate it so your site uses that instead of the defaults. It is important to make sure that the original php.ini settings from your server are also in this file, otherwise php may stop working.

  • Create a file called ‘create_ini.php’ in your web accessible directory (eg: /public_html/).
  • Change xxxx in the following code to the path to your web directory, and the following to the file:


<?php
// Put all the php.ini parameters you want to change below. One per line.
// Follow the example format $parm[] = "parameter = value";
$parm[] = "post_max_size = 200M";
$parm[] = "upload_max_filesize = 100M";
// full unix path - location of the default php.ini file at your host
// you can determine the location of the default file using phpinfo()
$defaultPath = "/usr/local/lib/php.ini";
// full unix path - location where you want your custom php.ini file
$customPath = "/xxxx/xxxx/public_html/php.ini";
// nothing should change below this line.
if (file_exists($defaultPath)) {
$contents = file_get_contents($defaultPath);
$contents .= "\n\n; USER MODIFIED PARAMETERS FOLLOW\n\n";
foreach (
$parm as $value) $contents .= $value . " \n";
if (
file_put_contents($customPath,$contents)) {
if (
chmod($customPath,0600)) $message = "The php.ini file has been modified and copied";
else
$message = "Processing error - php.ini chmod failed";
} else {
$message = "Processing error - php.ini write failed";
}
} else {
$message = "Processing error - php.ini file not found";
}
echo
$message;
?>

<?php phpinfo() ?>

  • Open http://www.yourwebsite.com/create_ini.php
  • You should see ‘The php.ini file has been modified and copied’ then a list of the new php parameters
  • Check that your parameters are now active, in my case they were not, I had to do one final thing:
  • Add the following line to your web directory .htaccess file, again replacing xxxx with the real path to your web directory:


SuPHP_ConfigPath /xxxx/xxxx/public_html/

  • Now run your script again at http://www.yourwebsite.com/create_ini.php
  • You should see the new parameters take effect!
  • Whatever is shown in the php info section, will be reflected in wordpress.

Leave a Reply...

How to force WordPress 3 to accept different upload File Types

If you are getting the ‘File type does not meet security guidelines’ error in WordPress 3.0.x, you can force it to accept other filetypes by modifying the /wp-includes/functions.php file, around line: 2456. I added this:

'dmg' => 'octet-stream',

in order to have it accept Mac .dmg Disk Image files.

  1. Thanks Nick! Very handy bit of knowledge!

Trackbacks/Pingbacks

  1. Añadir tipos validos a Wordpress 3.x | WebLog – Luis Puente - [...] electronicholas.com [...]

Leave a Reply...

Calendar Date Select

I have made available a fully functioning Demo of Calendar Date Select, the Javascript based visual date selector plugin for rails:

Calendar Date Select Rails Plugin

Source and homepage: http://code.google.com/p/calendardateselect/

  1. Your calendar demo has an internal server error. :(

Leave a Reply...

Subclassing Google Maps (v2)

I have been using my own subclassed version of the Google Maps GMap2 class for some time now. Here is how I do it:

function extend(subclass, superclass) {
function Dummy() {}
Dummy.prototype = superclass.prototype;
subclass.prototype = new Dummy();
subclass.prototype.constructor = subclass;
subclass.superclass = superclass;
subclass.superproto = superclass.prototype;
}

function MyMapClass(DomElement) {

MyMapClass.superclass.call(this, DomElement);
this.enableScrollWheelZoom();
this.enableContinuousZoom();
this.mycustomattribute = [];

}

Then:

extend(MyMapClass, GMap2);

MMC = new MyMapClass(document.getElementById("map"));

Leave a Reply...

Setting up a Rails app with Capistratio, SVN and SSH Keys on Site5

I have taken the plunge and got my hands dirty with rails in a shared hosting environment recently. I chose Site5 because they had a good deal on at the time, I think no more than $140 for 2 years. They are slower than my previous host, 4uhosting, perhaps because I am in the UK, but more likely because Site5 put both CPU and burst bandwidth caps on shared accounts, as most big hosting setups do. Anyway, in this article, I will explain how I got my ssh – svn – rails – capistrano setup going, with the help of a few tips from elsewhere in the ether.

Your Machine

First of all, this post on the Site5 forums was a help, if a little out of date in places. I aim to fill in some of the gaps and share my experiences in following the same rough plan. Ok let’s get started. If you haven’t already Step 0 is to get Ruby and Rails up and running on your own development machine. This is not something I will go into, as it is well documented – I’m on a Mac and this walkthrough, "Building
Ruby, Rails, LightTPD, and MySQL on Tiger;quot;
, was straightforward. However you do it, make sure you have mysql, ruby, rails, activerecord etc installed and understand how they all work together before you continue. If you creating a new rails project ‘rails projectname’ MAKE SURE YOU USE THE SAME VERSION AS YOUR HOST (Site5 currently has Rails 1.1.6 installed)! It’s not fun troubleshooting your code trying to work with two different versions of rails.

Next, you will want SVN installed on your machine. If you don’t know why, or think don’t think it’s worth the effort, then head to Wikipedia – Subversion or do some reading around so you understand the basics. Subversion helps you to manage your workcycle and takes a lot of pain out of version control. The best getting started guide for SVN I’ve found is at Circle Six. Get SVN working, and if you are new to it, try creating a test repository, checking out a version and committing changes.

SSH Public / Private Keys

It is very handy to have a public/private key pair set on your shared hosting account/local account respectively so you don’t have to keep typing your password when you perform actions with svn and later capistrano. It also saves time when you need to SSH into your hosting account. You will need SSH access enabled first though, and with Site5 you can do that yourself by going to ‘Advanced Tools’ in Site Admin page, and clicking ‘Get Shell Access’. Mine was enabled by default, but it was not a bash shell, which we need. After sending a ticket requesting bash, I was told simply to disable and re-enable it to enable bash. Excellent. If your host doesn’t have a control to do this, request that ssh and bash be enabled for you.

Now we can create an ssh public/private key pair to enable passwordless ssh entry to your hosting account (the private key is associated with your specific login on your own machine, so unless you are worried about who has access to your own user account on your computer then you can simply see this as a simple and secure timesaver). If you are running ‘unix you will have ssh installed by default. Open a new local command line and run these commands to create a .ssh folder and the key pair (here we are using rsa encryption, you can use dsa if you wish). Note mkdir will fail if there is already a directory by that name present, in which case just skip that command: cd ~
mkdir .ssh
cd .ssh
ssh-keygen -t rsa

Now name the key ‘id_rsa’. You don’t need a passphrase so just hit return twice. Next we make sure the permissions are correct on the private key, and upload the public key to your hosting account using the ‘scp’ command – the trailing colon ‘:’ is important.
cd ..
chmod 600 .ssh/id_rsa
scp .ssh/id_rsa.pub username@server.address:

Next ssh normally into your account (it will ask for your password), create a .ssh directory if needed, and append the public key value to authorized_keys. Finally, delete the now redundant .pub file, and set the correct permissions for the .ssh directory:
ssh username@server.address
cd ~
mkdir .ssh
cat id_rsa.pub >> .ssh/authorized_keys
rm id_rsa.pub
chmod 700 .ssh

Finally, you should be able to log out and log back into your remote server without typing a password – Oh the joys!
logout
ssh username@server.address
$ "Last Login...etc..." but NO password prompt!

Finally create a PRIVATE key on your remote server too. This is to allow Capistrano to use SVN without you having to type your password, in what would be, annoyingly, clear text. Preventing svn asking for a password during Capistrano operations when using svn+ssh:// took me a long time to figure out. If we were using http:// or file:/// we could use svn’s password caching to fix the problem, but since we are using ssh and we need to allow capistrano running on the server to authenticate using ssh, and its own public/private key pair. Creating them is much the same as with your local machine, but without the need to ‘scp’ it up. I actually just copied my local private key to the .ssh directory but this is not advisable so instead, ssh into your server and:
cd ~/.ssh
ssh-keygen -t rsa
<id_rsa>
chmod 600 id_rsa
cat id_rsa.pub >> authorized_keys
rm id_rsa.pub

SVN

Now let’s set up SVN on the remote server. First, if you haven’t already, create your rails application template somewhere on the server, or upload it if you have been working locally already. SSH into your server if you haven’t already and create the main repository. This will be the repository for your web application. As suggested on the Site5 forum, I just created mine in ~/repos:

ssh username@server.address
cd ~
svnadmin create repos

Import your rails app into your repository. The file path should be from the root of your shared hosting server. For Site5 (and the default Linux setup) it is /home/username/. The ‘trunk’ at the end of the repository path is important for later setup, and as good SVN practice.

svn import /home/username/path_to_rails_app file:///home/username/repos/rails_app_name/trunk -m "Initial Import"

You should now see the console happily list all the files being added to the repository. The structure you just imported is now stored in the database, ready for checkout. Personally, since you probably have imported a fresh template, I see no need to keep the original files, do I deleted them, but you may wish to move them to a backup folder. Those files will NOT be used again by SVN now they have been imported. We will use a working copy – so check one out. I stored mine in ~/rails.

svn checkout file:///home/username/repos/rails_app_name/trunk ~/rails/rails_app_name

Excellent. Now you should be able to check out a working copy for your local machine. Open a new prompt in your machine and:

cd ~
svn checkout svn+ssh://username@server.address/home/username/repos/rails_app_name/trunk path_for_local_rails_app

Note we are using the svnserve path here, NOT an http path. This uses ssh for svn authentication and your password is not cached. We will return to svn+ssh in the Capistrano setup.

Now, this last step is optional and described in the Circle Six article. Obviously you will be making changes to your local copy and committing them to write the changes to remote repository. Incidentally you should try this to make sure it is working. Change some files on your local copy and from your local machine: cd /path_for_local_rails_app/
svn commit -m 'testing local changes'

You should see ‘Sending file whatever_you_changed’ then ‘Committed revision X’. But these changes are NOT yet echoed to the working copy you checked out on the remote server. The latest version is only updated in the repository. You can automate the updating of the working copy on your SERVER by adding a simple hook to the commit action in the repository. Use an ftp client (or a command line editor if you are familiar with one) and on the server head to ~/repos/hooks. Remove the ‘.tmpl’ extension from the ‘post-commit.tmpl’ file and add the following to the bottom (comment out everything else unless you want it):
svn up /home/username/path_to_rails_app
This will automatically ‘version up’ your remote working copy as soon as the changes you have made locally have been committed to the repository. Great!

Capistrano

Capistrano is an automation tool, which facilitates speedy deployment by automating, among other things:

  • Database Migrations
  • Application and Database Server distribution
  • Server restarts
  • SVN updates and rollbacks

Even if you don’t yet see the need for Capistrano, you should become familiar with it if you intend to build more complex or higher load applications in the future. First apply the Capistrano magic to your rails app (creates 2 files to get you started with a few rails tasks and recipies). You can do this locally then ‘SVN’ the new files and the changes you make to them to your remote server later.
cd /path_to_local_rails_app/
cap --apply-to ./

The next part is often glossed over a bit, but if you are new to Capistrano, it can be a little tricky, especially if your setup is not the default. Capistrano needs some variables to be set properly before it will work. Open your newly created rails_app/config/deploy.rb file and set the variables to look something like this:

set :application, "rails_app_name"
set :repository, "svn+ssh://username@server.address/home/username/repos/#{application}/trunk"

role :web, "electronicholas.com"
role :app, "electronicholas.com"
role :db, "electronicholas.com", :primary => true

#assuming your remote application is in ~/rails/
set :deploy_to, "/home/username/rails/#{application}"
set :user, "username"

#remember the ssh keys we created earlier - enter the full path to each from the machine roots
ssh_options[:keys] = %w(/Users/local_user/.ssh/id_rsa /home/username/.ssh/id_rsa)
ssh_options[:host_key] = 'ssh-rsa'
ssh_options[:paranoid] = false
ssh_options[:username] = 'username'

And towards the bottom of the deploy.rb file, there is a ‘restart’ task definition. This won’t do much on Site5, but I’ve found this works great:
desc "Restart the web server by killing your fgci instance, forcing it restart upon the next request."
task :restart, :roles => :app do
run "pkill -9 -u electron -f dispatch.fcgi"
end

Excellent. Now you are ready to set up capistrano and use it as you wish, free from SVN password worries and with SSH security. First, though, make sure you commit these changes you’ve made to this local copy of your app to the remote version. To set up the standard deployment file structure you can now, from your local machine, run the following commands. Be sure you understand what they do beforehand though.
cd path_to_local_rails_app
cap setup

And to deploy:
cap deploy

One last thing…

Make sure you amend your rails application’s root .htaccess file to tell the server to use FastGCI. I was tearing my hair out for weeks with the slowness of it all, until I realised I had not configured it correctly (I thought I had). It’s just a case of adding an ‘f’ to the end of dispatch.cgi on top of what’s already there:
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Enjoy :-)

Leave a Reply...

content top