Our Blog

Tip: Running command line / shell commands in Ruby using %x

7 October 2007 08:08, Posted by Jon

I thought I would post a very quick tip on how to execute a command line / shell command with Ruby. There are several ways to run command lines / shell commands in Ruby as discussed by Jay Fields however by far the most useful of these is the %x command, as follows:

  1. @whois = %x[whois www.gotripod.com]

And what is important and not mentioned by Jay is the fact that you can pass parameters into %x[] as follows:

  1. dom = www.gotripod.com
  2. @whois = %x[whois #\{dom\}]



Tip: ASP.Net/AJAX – Javascript in Label/Textbox Text

24 April 2007 18:17, Posted by Jon

Hi All,

I though I would share a problem that I had (and resolved) using ASP.Net AJAX. The problem occurs if you want to output some Javascript to a Textbox (for example: for a user to copy and paste into their own page), which is nested in an UpdatePanel. AJAX returns an HTTP 500 error.

The reason seems to be that the Javascript in the textbox interferes with the javascript generated by MS AJAX to handle the partial page updates of the UpdatePanel.

So if like me you need to output some Javascript to the page for a user to cut and paste, a work around is to use a literal control and the HTMLEncode function of the Server object as follows:

  1. Literal1.Text = Server.HTMLEncode(<Script src=’example.js’ type=’text/javascript’></script>)

I hope that helps anyone that has been puzzled by this error.



Tip: Creating stronger passwords.

23 April 2007 18:05, Posted by Jon

In this day and age we often get asked for passwords to secure our content or personal information. Many people find if difficult to come up with memorable passwords and popular choices are things like the day of the week when they set it or literally the word “password”! So, I though I would share my way of coming up with a memorable password that appears to be a random string of characters

For this method you need to come up with a phrase of several words. This may be relevant to a particular the site or company or personal to you in some way, it could be some lyrics to a song or poem or a private thought etc. For an example I will use the following well known line from a nursery rhyme:

Jack and Jill went up the hill to fetch a pale of water”

We can easily turn this into a memorable password by using the first letters, so in the above case, we get:

jajwuthtfapow

Already, we have a 13 character password. However, we can make this stronger still, by using other common techniques, for example swapping words that sound like numbers for their corresponding number. i.e. to = 2 or for = 4. So with the above example, we get:

jajwuth2fapow

We can also add in symbols (where supported). For example we could swap and for + or &. So again with the example above we end up with:

j+jwuth2fapow

Remembering the phrase and the simple substitution rules for numbers and symbols provides us with a good strengthen password. Obviously we still should use different passwords for different sites and it is also wise to have a phrase that isn’t obviously related to a particular site.



Go Tripod Ltd

Go Tripod Ltd is a UK-based development company working with some of the most exciting software technologies around. Simon Ashley, Jon Baker and Colin Ramsay are the brains behind projects such as Stubmatic, and are developing bespoke web, mobile and desktop software for clients with household names. We believe in good service as well as good software, and we’re eager to work with people who feel the same.