In which I tell you my password for this website

 

I exaggerate. I’m not really going to tell you my password but I am going to tell you roughly how I created it. You may find it useful when thinking about your own passwords.

Over the years I got into the habit of using the same weakish password for every website I registered on. This was OK for a while then one of the sites I use got its password hashes published and within a few days they were cracked and my password was there for all to see.

I decided to do the sensible thing and create a strong, unique password for each site I use. The two problems I had are the same as everyone else:

  1. I wanted the passwords to be easy for me to remember but hard to crack
  2. I wanted them to be easy to enter on my phone

The second design goal was the one which made my approach slightly different to other ones you see around.

Here’s how I make my passwords:

  • To make a password that’s unique for every site you need to incorporate some attribute of that site into the password
  • If you have multiple accounts on the site, each should have a different password. So your algorithm needs to take account of your identity too.
  • The password must be long enough to be strong but short enough to enter on a phone keyboard
  • The password should only use the characters available unmodified on your phone keyboard (it’s too painful to keep changing the keyset for me)

The characters I have available on my Android phone are the lowercase letters a-z and the punctuation keys “,”, “.” and space. Your phone may be different.

Here are the components of my password:

  1. A word that’s memorable to me, let’s say “fart”
  2. Some letters from the website’s domain name
  3. Some letters from my email address
  4. Some mandatory punctuation

An example. Let’s say I’m signing up to Facebook with the email address dominic@sayers.cc

My password would be fart fcbk ae.. ,,

It’s made up as follows

  1. My memorable word, “fart”
  2. A space
  3. The consonants from the web site’s domain name, padded out to a length of 4 by full stops.
  4. A space
  5. The vowels from the domain name of my email address, padded out to a length of 4 by full stops
  6. Some punctuation; a space followed by two commas.

So my password is 17 characters long: not perfect but strong enough for today’s brute force attacks. It uses all the keyspace available without fiddling around on my phone’s keyboard. It’s unique for every account on every website (barring coincidences). It’s easy to remember.

You can obviously vary these elements considerably to suit yourself. For instance you could use the last four letters in the website’s name, maybe reversed or something. Rearrange the elements I’ve used.

This isn’t my actual algorithm, by the way. Just a little bit like it.

Notes:

  1. Please don’t tell me about the XKCD cartoon. I know about it. I’m not going to type in a 28-character password on my phone.
  2. A password using this algorithm doesn’t lend itself to dictionary attacks or even rainbow table attacks. A brute force attack using today’s hardware would take an inordinate amount of time according to this chart:

 

Getting online

I’ve been asked a few times recently for general advice about getting a new business or project online. Here’s the skinny.

Any new business or project is going to need an online presence. So you just need to go and register a domain with GoDaddy, right? Stop! First read this handy guide to how to get it right.

You need three basic things

  1. A registered name
  2. A way of telling the internet where your services are hosted
  3. Hosting for your services (web site and email at least)

When you register a domain name, the registrar will want to do all these things for you. That way they get to keep all your money. But there are good reasons for keeping everything separate. Now read on…

Choosing a name

It’s fun choosing your name, but it’s not easy these days because all the good ones have already been taken. Here’s some things to consider that you might not have thought of:

  1. A .com domain name.
    D’oh!  Of course you thought of that. But if you didn’t then you should. Plenty of people will try the .com version of your name even if you register it somewhere else.
  2. A domain name in another top level domain.
    If you plan to allow users to make comments on your web site or even to upload files then consider having an alternate domain name that is not subject to US laws.
  3. A Twitter handle.
    Twitter is pretty crowded these days and getting your name as a Twitter handle will not be easy. And Twitter doesn’t have a secondary market in handles so you can’t make someone else an offer for theirs..

Registering your name

You need to tell the gods of the internet that you have chosen your name. You do this through a registrar. Many companies will act as a registrar for you because it’s money for old rope. They will also offer you other services like hosting and email. Here’s why you shouldn’t use the same company for everything.

Your domain names are your branding (and your trademark if you register it). It’s your identity and you should keep tight control of it. If you were a big company then your domain names would be under the control of your legal or marketing department, not your techies. If you outsource your web development, for example, you don’t want the developers owning your brand – what if you fall out with them?

So register the domain names yourself, but don’t buy any other services from the registrar. Keep the credentials for your account at the registrar very safe. Nobody else needs to know them except you. Ever. If they say they do then they are trying to rip you off.

My recommended registrar: Gandi. Many countries have appalling internet legislation that compels internet service providers to pull your domain on the say-so of law enforcement agencies. France, where Gandi are domiciled, is no exception. But Gandi at least have a policy of pushing back when asked to do something that is not in the customer’s interest. GoDaddy, on the other hand, are happy to hand over your data and your domain to the US security services at the request of a junior officer.

You’ll also need to register a Twitter handle. To do this you’ll need an email address, so let’s defer this until we’ve got our domain email services working. Registering a Twitter handle is easy: you’re just creating a Twitter account in the normal way.

Hosting your services

It’s no good having a domain name unless you use it for something. Here’s some of the services you might use it for:

  1. Email
    You’ll probably want email addresses at your domain (you@yourdomain.com). The easiest way to do this is Google Apps. To complete the setup of Google Apps you’ll need to verify that the domain is yours – we’ll cover this in the following section about the Domain Name System. When you’ve got your email accounts set up, don’t forget to go and register your Twitter handle.
  2. Website or web application
    Traditionally your website would be hosted by a provider that gave you access to a virtual machine. On this machine would be a web server and you could simply upload HTML or PHP pages to create your site. The problem with this way of doing things is that it’s fiddly to keep track of what you uploaded and when. This model has been replaced somewhat by the idea of an application server. Providers like Heroku or AppFog will link to your web developer’s source code control systems to create more effective release control system.
  3. Blog
    Your blog is just another application, hosted by an application server. There are many companies that will do this for you. I happen to use WordPress software hosted on my own old-fashioned virtual server. But WordPress as a company will host your blog for you if you want.

Tying the bits together

As it stands we’ve got a domain name (good) and email addresses like phil@yourdomain.com.test-google-a.com (bleugh!) and maybe a website at http://yourdomain.herokuapp.com (yuk!)

This isn’t what we want. We want emails like phil@yourdomain.com and our website to be at http://yourdomain.com – how do we do this?

The thing we need is the Domain Name System (DNS). Your domain has name servers. These servers tell the internet where your own services are located. It’s a bit of internet plumbing that we need to use to tie it all together. Bear with me, it’s not that hard.

I recommend using Cloudflare for your name servers. They are specialists at this and they do a free account that gives you all your basic needs, plus a lot of extra value on top. The Cloudflare account setup gives you all the help you need to get your services running on the right domain names.

When you’ve been through the Cloudflare setup you’ll understand it a lot more. But the basic steps are:

  1. Tell the DNS where your web hosts are
  2. Tell the DNS where your mail servers are
  3. Tell your registrar who is running your name servers

The last step is what achieves the important separation of responsibility between your registrar and your other service providers. It gives you the freedom to choose the best-of-breed hosting provider, email provider and DNS provider. You don’t have to be tied to your registrar for these services any more.

If you’re using Google Apps, the final step is to verify to Google that you own the domain. Google Apps setup will help you through this, but it’s very easy with Cloudflare to set up a TXT record containing information provided by Google. You’ll see what I mean when you try it.

Comments and suggestions appreciated.

 

How to edit Erb files using Notepad++

If you’re one of the tiny band of people developing Ruby or Rails code on Windows, then you might have tried editing .erb files with Notepad++. In general, Notepad++ is a very nice little text editor. It’s my only IDE. But it’s not very good at .erb files. Here’s an example:

Without SciLexerYuk.

There’s two problems here. One is the godawful color scheme. But other is more serious: Notepad++ fails to recognise the quoted text within a pair of <% ... %> braces.

The cause of this is the parsing engine built into Notepad++: Scintilla. Scintilla thinks that <% ... %> braces indicate ASP code, and therefore a single quote indicates the start of a comment. The “comment” includes the closing brace at the end of the line, so the rest of the document is parsed as an ASP comment.

I’m using Notepad++ 5.9.3, the latest version at the time of writing. This uses the Scintilla SciLexer.dll version 2.2.7. More recent versions of the dll don’t have this problem, so the solution is straightforward: replace Notepad++’s dll with a more recent one. Here’s how to do it step by step:

  1. Close Notepad++
  2. Download the Scintilla text editor, SciTE. The latest version at the time of writing is here: http://sourceforge.net/projects/scintilla/files/SciTE/2.29/ and the file you want is wscite229.zip.
  3. Extract the .zip file somewhere handy.
  4. Navigate to the Notepad++ installation folder. Mine is at C:Program Files (x86)Notepad++ but you may have installed it somewhere else.
  5. Rename SciLexer.dll as SciLexer.bak
  6. Copy SciLexer.dll from your SciTE package to your Notepad++ folder
  7. Restart Notepad++

You will be asked by Windows if you really want to mess around in the Program Files folder. Yes, you do.

Hurrah! Now the .erb braces are parsed correctly:

But it’s still a naff colour scheme.

If you look in Notepad++’s Style Configurator, you won’t find anything in Global Styles or HTML to change this. There isn’t an Erb language specification. So how do we change the colour of the braces?

Notepad still thinks they are ASP braces. The style it is rendering is the ASPSYBOL style in the asp language configuration. Here’s how to change it:

  1. Settings > Style Configurator
  2. In the Language selector, choose asp
  3. In the Style selector, choose ASPSYBOL
  4. Change the Foreground color and Background color to a cool new style.
  5. Save & Close

Now your .erb file looks like this:

Win!

Go and write some nice Rails code and ignore all those dudes telling you to get a Mac.

HOWTO Create a simple parent-child form in Rails 3.1

I’m finding Rails quite difficult conceptually. People tell me one day the light will dawn and it will all seem perfectly natural. At the moment though it seems like there’s 1000 ways to achieve any given objective, but only one right one. If you choose one of the other 999 then you’re in a world of manual coding as a result.

I couldn’t find a really basic example of nested forms: a parent record with an arbitrary number of child records. Here’s my attempt to create the simplest possible parent-child forms, with the minimum configuration and the maximum convention. Rails experts: I’d love to reduce this even further – please give me any suggestions for doing so.

The resulting forms can be cloned directly from https://github.com/moo-li/Simple-parent-child-forms-in-Rails-3.1, but here’s how to create them yourself:

  1. At the command prompt, create a new Rails application:
    rails new myapp (where myapp is the application name). If you want HTML5
    goodness then rails new myapp -m https://github.com/russfrisch/h5bp-rails/raw/master/h5bp.rb.
  2. cd myapp
  3. rails g scaffold Mom name:string
  4. rails g model Kid name:string mom:references
  5. Add the following lines to app/models/mom.rb
    has_many :kids, :dependent => :destroy
    accepts_nested_attributes_for :kids, :allow_destroy => :true
  6. rake db:migrate
  7. In config/routes.rb, change resources :momsto
    resources :moms do
      resources :kids
    end
  8. rails g controller Kids
  9. Add the following methods to app/controllers/kids_controller.rb
    def create
      @mom = Mom.find(params[:mom_id])
      @kid = @mom.kids.create(params[:kid])
      redirect_to mom_path(@mom)
    end
    
    def destroy
      @mom = Mom.find(params[:mom_id])
      @kid = @mom.kids.find(params[:id])
      @kid.destroy
      redirect_to mom_path(@mom)
    end
  10. Add the following lines to app/views/moms/show.html.erb before the line
    containing <%= link_to 'Edit', edit_mom_path(@mom) %> |

    <h2>Kids</h2>
    <%= render @mom.kids %>
    
    <h3>Add kid</h3>
    <%= render 'kids/form' %>
  11. Create a file app/views/kids/_kid.html.erbwith the following code:
    <p>
      <strong>Kid:</strong>
      <%= kid.name %>
      <%= link_to 'Remove', [kid.mom, kid], :confirm => 'Really remove kid?', :method => :delete %>
    </p>
  12. Create a file app/views/kids/_form.html.erbwith the following code:
    <%= form_for([@mom, @mom.kids.build]) do |f| %>
      <div class="field">
        <%= f.label :name %> <%= f.text_field :name %>
      </div>
    
      <div class="actions">
        <%= f.submit %>
      </div>
    <% end %>
  13. rails s
  14. Point your browser to http://localhost:3000/moms.

Parsing the Cricinfo DRS text

NB this post may be of limited interest (read: zero interest) to anybody but me.

Cricinfo records Umpire Decision Review System (DRS or UDRS) outcomes in its match notes. Here are a few examples:

  • Over 18.2: Refferal by South Africa, Umpire- SJ Davis, Batsman- AG Prince(Upheld)
  • Over 39.2: Referral by England, Umpire- Aleem Dar, Batsman- JH Kallis (Struck down)
  • Over 3.5: Review by Australia (Bowling), Umpire – Aleem Dar, Batsman – IJL Trott (Struck down)
  • 34.5: Referral by Australia, Umpire-MR Benson, Batsman – S Chanderpaul (Struck down)
  • Over 103.1 Referral by West Indies, Umpire-IJ Gould, Batsman – SJ Benn (Struck down)
  • Over 16.3; Referral by Australia, Umpire BF Bowden, Batsman-SR Watson (Struck down)

Here, as far as I can make out, is the ABNF describing the Cricinfo match notes that tell us about DRS outcomes:

Review-text     = ["Over" 1*WSP] Over-ball [":" / ";"] Review-name Team [Role] ", " Umpire ", " Batsman Outcome

Over-ball       = 1*3DIGIT "." Ball ; When the review happened in the innings

Ball            = %x30-36 ; 0-6 (assuming 6-ball overs)

Review-name     = 1*WSP ["Review" / "Referral" / "Refferal"] " by " ; Has been referred to using various names (and typos)

Team            = "England"
                / "Australia"
                / "South Africa"
                / "India"
                / "Pakistan"
                / "Sri Lanka"
                / "West Indies"
                / "New Zealand"
                / ICC-member

ICC-member      = 1*ALPHA ; Unique string identifying the team asking for the review

Role            = 1*WSP "(" ("Batting" / "Bowling") ")"

Umpire          = "Umpire" [*WSP "-" *WSP] Umpire-name

Umpire-name     = 1*ALPHA

Batsman         = "Batsman" [*WSP "-" *WSP] Batsman-name

Batsman-name    = 1*ALPHA

Outcome         = *WSP "(" ("Upheld" / "Struck down") ")"

HOWTO Upgrade Bugzilla 3.6 to 4.0 on Ubuntu

If I had known what a 1337 exercise this was going to be I would have ignored the  seductive message that appeared on my Bugzilla home page.

WARNING: If Bugzilla tries to tempt you into upgrading from 3.6 to 4.0 then you should know this is not very well automated.

My server was running Bugzilla 3.6 on Ubuntu 10.04.2 LTS with Apache 2.2.14 and MySQL 5.1.41

Here’s what I had to do (from memory – sorry).

  1. apt-get install libapache2-mod-perl2 apache2-dev
  2. Create a file called /etc/apache2/mods-enabled/perl.conf with the following lines (check the path is correct for your installation)
    PerlSwitches -w -T
    PerlConfigRequire /var/www/bugzilla/mod_perl.pl
  3. Edit the Apache conf file for the Bugzilla site (on my server it was /etc/apache/sites-enabled/000-default). Make sure there is a <Directory> entry for your Bugzilla installation. Make sure the AllowOverride line is correct according to the Bugzilla installation instructions. Mine looked like this after:
    <Directory /var/www/bugzilla>
            AllowOverride Limit FileInfo Indexes
    </Directory>
  4. Enable the following Apache modules (I use Webmin to do this; if you want to do this the man’s way then ask a nerd):
    • mod_headers
    • mod_expires
    • mod_env
  5. Restart Apache. There may be a clever way to do this, but I used /etc/init.d/apache2 restart
  6. Follow the instructions in the tempting message on the home page, then do the following additional steps
  7. cd /var/www/bugzilla
  8. ./checksetup.pl
  9. Whoa! It’s all broken. Never mind – if you look carefully you’ll see the magic command to fix everything is there. It looks something like /usr/bin/perl install-module.pl all (copy it from the output of checksetup.pl, not from here)
  10. If you’re getting error messages at the bottom of the output from checksetup.pl then try this
    /usr/bin/perl install-module.pl DateTime:Locale

That’s pretty much it. If it still doesn’t work then try restarting Apache again. If you have to do anything else then let me know and I’ll add it here. Also if I’ve made any mistakes then I’m happy to correct them.

HOWTO Install dig on Windows 7


The short version:

  1. Create a folder for the dig application (I used E:\apps\dig)
  2. Download the latest version of BIND from the Internet Systems Consortium website.
  3. Open the .zip archive and extract dig.* and *.dll into your application folder
  4. Add the application folder to your path
  5. Double-click vcredist_x86.exe to install the Microsoft Visual C++ 2005 Redistributable (you may not need to do this if you’re sure it’s already installed)

All of these steps might need a little more explanation for an inexperienced person. But then if you’re an inexperienced person, why do you need dig? Happy to expand on any of the above steps if you wish – just add a comment here.


HOWTO install Ruby on Rails on Windows and deploy to Heroku

Why I’m writing this

I tried for over two days to install Ruby on Rails on my Windows 7 machine so that I could deploy an app to Heroku. Eventually I did it – it wasn’t hard but I needed to collate information that wasn’t easily to be found in one place. So I’m collating it here.

This is the record of an installation at a particular moment in time: January 2011. By the time you read this, the situation may have changed. If so, please let me know and I’ll update this page.

My principle stumbling blocks were these:

  1. The default install of Ruby (1.9.2) is not compatible with the Heroku deployment widget.
  2. Heroku does not like apps that use the Rails default database (sqlite3).

Problem 1 will probably go away quite soon when Heroku update their widget. Problem 2 is easy to fix but it took me long time to find out how to fix it.

What I did

What follows is the step-by-step guide to how I got a working install. If you’re too impatient to follow this the executive summary is: (1) Install stuff using RailsInstaller, (2) edit the Gemfile before deployment to let Heroku use its own database. Here’s the detail:

  1. You need compatible versions of Ruby, Rails and Git. If you have any of these currently installed then I suggest you uninstall them before you go on.
  2. Download and run the RailsInstaller kit. Follow the defaults unless you want to install it elsewhere. I installed mine to E:AppsRailsInstaller and it works fine.
  3. From a command window, enter ruby -v
    You should see something like this ruby 1.8.7 (2010-12-23 patchlevel 330) [i386-mingw32]
  4. Enter gem -v
    You should see something like this 1.3.7
  5. Enter rails -v
    You should see something like this Rails 3.0.3
  6. Enter git version
    You should see something like this git version 1.7.3.1.msysgit.0
  7. Enter sqlite3 --version
    You should see something like this 3.7.3
  8. OK, we have a basic platform. Now to install the Heroku gem. This is described here: please look at this if you have problems with public keys etc. Hopefully you will just have to enter gem install heroku
    With a little luck you will see something like this:
    Successfully installed rest-client-1.6.1
    Successfully installed configuration-1.2.0
    Successfully installed launchy-0.3.7
    Successfully installed heroku-1.17.8
    4 gems installed
    Installing ri documentation for rest-client-1.6.1...
    Installing ri documentation for configuration-1.2.0...
    Installing ri documentation for launchy-0.3.7...
    Installing ri documentation for heroku-1.17.8...
    Installing RDoc documentation for rest-client-1.6.1...
    Installing RDoc documentation for configuration-1.2.0...
    Installing RDoc documentation for launchy-0.3.7...
    Installing RDoc documentation for heroku-1.17.8...
  9. Now you should be able to enter heroku version and see something like heroku-gem/1.17.8
  10. Change directory to where you want to put the application’s files. They will go in a new folder you are about to create.
  11. Enter rails new tutorialappand you will see this kind of thing:
          create
          create  README
          create  Rakefile
          create  config.ru
          create  .gitignore
          create  Gemfile
          create  app
          create  app/controllers/application_controller
          create  app/helpers/application_helper.rb
          create  app/mailers
          create  app/models
          create  app/views/layouts/application.html.erb
          create  config
          create  config/routes.rb
          create  config/application.rb
          create  config/environment.rb
          create  config/environments
          create  config/environments/development.rb
          create  config/environments/production.rb
          create  config/environments/test.rb
          create  config/initializers
          create  config/initializers/backtrace_silencer
          create  config/initializers/inflections.rb
          create  config/initializers/mime_types.rb
          create  config/initializers/secret_token.rb
          create  config/initializers/session_store.rb
          create  config/locales
          create  config/locales/en.yml
          create  config/boot.rb
          create  config/database.yml
          create  db
          create  db/seeds.rb
          create  doc
          create  doc/README_FOR_APP
          create  lib
          create  lib/tasks
          create  lib/tasks/.gitkeep
          create  log
          create  log/server.log
          create  log/production.log
          create  log/development.log
          create  log/test.log
          create  public
          create  public/404.html
          create  public/422.html
          create  public/500.html
          create  public/favicon.ico
          create  public/index.html
          create  public/robots.txt
          create  public/images
          create  public/images/rails.png
          create  public/stylesheets
          create  public/stylesheets/.gitkeep
          create  public/javascripts
          create  public/javascripts/application.js
          create  public/javascripts/controls.js
          create  public/javascripts/dragdrop.js
          create  public/javascripts/effects.js
          create  public/javascripts/prototype.js
          create  public/javascripts/rails.js
          create  script
          create  script/rails
          create  test
          create  test/fixtures
          create  test/functional
          create  test/integration
          create  test/performance/browsing_test.rb
          create  test/test_helper.rb
          create  test/unit
          create  tmp
          create  tmp/sessions
          create  tmp/sockets
          create  tmp/cache
          create  tmp/pids
          create  vendor/plugins
          create  vendor/plugins/.gitkeep
  12. Enter cd tutorialapp to move to your app’s folder
  13. Enter bundle installand gem will install anything your app needs
    Fetching source index for http://rubygems.org/
    Using rake (0.8.7)
    Using abstract (1.0.0)
    Using activesupport (3.0.3)
    Using builder (2.1.2)
    Using i18n (0.5.0)
    Using activemodel (3.0.3)
    Using erubis (2.6.6)
    Using rack (1.2.1)
    Using rack-mount (0.6.13)
    Using rack-test (0.5.7)
    Using tzinfo (0.3.24)
    Using actionpack (3.0.3)
    Using mime-types (1.16)
    Using polyglot (0.3.1)
    Using treetop (1.4.9)
    Using mail (2.2.14)
    Using actionmailer (3.0.3)
    Using arel (2.0.7)
    Using activerecord (3.0.3)
    Using activeresource (3.0.3)
    Using bundler (1.0.9)
    Using thor (0.14.6)
    Using railties (3.0.3)
    Using rails (3.0.3)
    Using sqlite3 (1.3.3)
    Installing sqlite3-ruby (1.3.3)
    Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
  14. Enter rails server and the mini web server will start your application on port 3000.
    You should see this in the command window
    => Booting WEBrick
    => Rails 3.0.3 application starting in development on http://0.0.0.0:3000
    => Call with -d to detach
    => Ctrl-C to shutdown server
    [2011-01-21 14:33:22] INFO WEBrick 1.3.1
    [2011-01-21 14:33:22] INFO ruby 1.8.7 (2010-12-23) [i386-mingw32]
    [2011-01-21 14:33:22] INFO WEBrick::HTTPServer#start: pid=8932 port=3000

    and this in a web browser when you navigate to http://localhost:3000
  15. Enter Ctrl-C in the command window to terminate the local web server
  16. Enter git init and git will initialize a repository in the current folder.
    Initialized empty Git repository in C:/Path/to/your/dev/folder/tutorialapp/.git/
  17. Enter git add .
  18. Enter git commit -m "first commit"
    [master (root-commit) fd8c17d] first commit
     40 files changed, 10287 insertions(+), 0 deletions(-)
     create mode 100644 .gitignore
     create mode 100644 Gemfile
     create mode 100644 Gemfile.lock
     create mode 100644 README
     create mode 100644 Rakefile
     create mode 100644 app/controllers/application_controller.rb
     create mode 100644 app/helpers/application_helper.rb
     create mode 100644 app/views/layouts/application.html.erb
     create mode 100644 config.ru
     create mode 100644 config/application.rb
     create mode 100644 config/boot.rb
     create mode 100644 config/database.yml
     create mode 100644 config/environment.rb
     create mode 100644 config/environments/development.rb
     create mode 100644 config/environments/production.rb
     create mode 100644 config/environments/test.rb
     create mode 100644 config/initializers/backtrace_silencers.rb
     create mode 100644 config/initializers/inflections.rb
     create mode 100644 config/initializers/mime_types.rb
     create mode 100644 config/initializers/secret_token.rb
     create mode 100644 config/initializers/session_store.rb
     create mode 100644 config/locales/en.yml
     create mode 100644 config/routes.rb
     create mode 100644 db/seeds.rb
     create mode 100644 doc/README_FOR_APP
     create mode 100644 lib/tasks/.gitkeep
     create mode 100644 public/404.html
     create mode 100644 public/422.html
     create mode 100644 public/500.html
     create mode 100644 public/favicon.ico
     create mode 100644 public/images/rails.png
     create mode 100644 public/index.html
     create mode 100644 public/javascripts/application.js
     create mode 100644 public/javascripts/controls.js
     create mode 100644 public/javascripts/dragdrop.js
     create mode 100644 public/javascripts/effects.js
     create mode 100644 public/javascripts/prototype.js
     create mode 100644 public/javascripts/rails.js
     create mode 100644 public/robots.txt
     create mode 100644 public/stylesheets/.gitkeep
     create mode 100644 script/rails
     create mode 100644 test/performance/browsing_test.rb
     create mode 100644 test/test_helper.rb
     create mode 100644 vendor/plugins/.gitkeep
  19. Enter heroku create
    Enter your Heroku credentials.
    Email: joe@example.com
    Password:
    Uploading ssh public key /Users/joe/.ssh/id_rsa.pub
    Creating blooming-wind-752..... done
    http://blooming-wind-752.heroku.com/ | git@heroku.com:blooming-wind-752.git
    Git remote heroku added
  20. This is the only time Heroku will ask for your credentials. If you have an existing id_rsa.pub file in the .ssh folder in your home directory then Heroku will use it. Otherwise it will create one for you (if I remember correctly).
  21. There is now a Heroku app ready for your code. We just need to upload the code we commited to git. To do this enter git push heroku masterand you will see this
    Warning: Permanently added the RSA host key for IP address '75.101.145.87' to the list of known hosts.
    Counting objects: 63, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (48/48), done.
    Writing objects: 100% (63/63), 85.99 KiB, done.
    Total 63 (delta 3), reused 0 (delta 0)
    
    -----> Heroku receiving push
    -----> Rails app detected
    -----> Detected Rails is not set to serve static_assets
           Installing rails3_serve_static_assets... done
    -----> Gemfile detected, running Bundler version 1.0.3
           Unresolved dependencies detected; Installing...
           Fetching source index for http://rubygems.org/
           Installing rake (0.8.7)
           Installing abstract (1.0.0)
           Installing activesupport (3.0.3)
           Installing builder (2.1.2)
           Installing i18n (0.5.0)
           Installing activemodel (3.0.3)
           Installing erubis (2.6.6)
           Installing rack (1.2.1)
           Installing rack-mount (0.6.13)
           Installing rack-test (0.5.7)
           Installing tzinfo (0.3.24)
           Installing actionpack (3.0.3)
           Installing mime-types (1.16)
           Installing polyglot (0.3.1)
           Installing treetop (1.4.9)
           Installing mail (2.2.14)
           Installing actionmailer (3.0.3)
           Installing arel (2.0.7)
           Installing activerecord (3.0.3)
           Installing activeresource (3.0.3)
           Using bundler (1.0.3)
           Installing thor (0.14.6)
           Installing railties (3.0.3)
           Installing rails (3.0.3)
           Installing sqlite3-ruby (1.3.3)
           Your bundle is complete! It was installed into ./.bundle/gems/
           Compiled slug size is 3.7MB
    -----> Launching... done
           http://blooming-wind-752.heroku.com deployed to Heroku
    
    To git@heroku.com:blooming-wind-752.git
     * [new branch]      master -> master
  22. Now enter heroku openand the app will open in your browser. Unfortunately you will get the dreaded App Crashed message:

    App crashed. Please check your Heroku logs for the backtrace.

  23. To fix this, edit the file Gemfilein the root folder of your app. Change the following line
    gem 'sqlite3-ruby', :require => 'sqlite3'

    to look like this

    group :development, :test do gem 'sqlite3-ruby', :require => 'sqlite3' end

    What this does is tell Rails you want to use the sqlite3 database in your development and test environments, and you don’t specify what Heroku will use in the production environment. This make Heroku happy. Heroku no like sqlite3.

  24. git add .
  25. git commit -m "second commit"
    [master d0bfbc5] second commit
     1 files changed, 3 insertions(+), 1 deletions(-)
  26. git push heroku
    Counting objects: 5, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 318 bytes, done.
    Total 3 (delta 2), reused 0 (delta 0)
    
    -----> Heroku receiving push
    -----> Rails app detected
    -----> Detected Rails is not set to serve static_assets
           Installing rails3_serve_static_assets... done
    -----> Gemfile detected, running Bundler version 1.0.3
           Unresolved dependencies detected; Installing...
           Fetching source index for http://rubygems.org/
           Installing rake (0.8.7)
           Installing abstract (1.0.0)
           Installing activesupport (3.0.3)
           Installing builder (2.1.2)
           Installing i18n (0.5.0)
           Installing activemodel (3.0.3)
           Installing erubis (2.6.6)
           Installing rack (1.2.1)
           Installing rack-mount (0.6.13)
           Installing rack-test (0.5.7)
           Installing tzinfo (0.3.24)
           Installing actionpack (3.0.3)
           Installing mime-types (1.16)
           Installing polyglot (0.3.1)
           Installing treetop (1.4.9)
           Installing mail (2.2.14)
           Installing actionmailer (3.0.3)
           Installing arel (2.0.7)
           Installing activerecord (3.0.3)
           Installing activeresource (3.0.3)
           Using bundler (1.0.3)
           Installing thor (0.14.6)
           Installing railties (3.0.3)
           Installing rails (3.0.3)
           Installing sqlite3-ruby (1.3.3)
           Your bundle is complete! It was installed into ./.bundle/gems/
           Compiled slug size is 3.7MB
    -----> Launching... done
           http://blooming-wind-752.heroku.com deployed to Heroku
    
    To git@heroku.com:blooming-wind-752.git
       fd8c17d..d0bfbc5  master -> master
  27. With luck and a following wind, when you now try heroku open your Heroku-hosted app will now look like this:
  28. That’s it from me. You’re now on your own making the app do something useful…

There are plenty of other tutorials on Getting Started with Ruby on Rails and Heroku. This is just to get you over a hurdle that I faced and which took me a lot of effort to get over. Hopefully I’ve saved you some time.
Thanks to Jan Jones for the RailsInstaller tip.

Uninstalling Windows Live Essentials

I tried to uninstall Windows Live Essentials. The uninstaller ran fine and looked like it was doing everything it should. But the damn thing wouldn’t go away.

Google.

43,000 people having the same problem as me.

Search microsoft.com, live.com, msdn.com. Nothing, of course.

Here’s what I did to get rid of it:

1. Downloaded the installer from http://explore.live.com/windows-live-essentials

2. Ran it

3. Chose Repair

4. Rebooted

5. Uninstalled

Obvious really. But hopefully the next 43,000 people will find some useful information here instead of 43,000 blind alleys.

Moving this blog to a new host was a bit of a kerfuffle

Sorry for the outage since Sunday. I moved the contents of this blog away from wordpress.com because I didn’t want to pay for another year’s hosting there when I have a perfectly good host elsewhere.

The move of the blog contents took 5 minutes.

Releasing the sub-domain blog.dominicsayers.com from the clutches of wordpress.com and getting SiteGround to set it up took 48 hours.

Lessons learned:

1. If you’re thinking of choosing a new hosting provider, try to get a look at the hosting control panel first. I’ve now had three faults with SiteGround that were simply because their tools don’t work.

2. I chose to keep my Name Server management away from SiteGround because their tools (a) didn’t work and (b) didn’t let me view or edit my DNS records explicitly. Don’t nanny me if I don’t want to be nannied. Because my name servers are not under their control, this broke some of their other tools. How about testing this stuff before releasing it, people?

3. SiteGround tech support are helpful and responsive.

Other things I’ve noticed: some of the WordPress plug-in writers have stopped maintaining their plug-ins. Is WordPress a dying platform? Is blogging a dying art?