Mar 10 2011

Some Useful Information for Setting Up Subversion on Ubuntu

Posted by admin in Computers

Not a tutorial or guide this time, since everyone else seems to have this covered quite well, but thought I’d collect a few good links together in one place. Hopefully these links will be useful to someone just starting with SVN. For everyone who isn’t using some type of version control, nows your chance!

Ubuntu tutorial for installation:
http://danielabrantes.blogspot.com/2010/11/install-subversion-in-ubuntu-1010.html

Beginner HowTo (suited to WordPress plugin devs, but still good to apply to your own setup):
http://codex.wordpress.org/Using_Subversion

Multi-platform SVN client – RapidSVN:
I found this client especially useful since it works across platforms and it is lightweight and quick.
http://rapidsvn.tigris.org/


RapidSVN Screenshot
 

Popular Windows SVN client – TortoiseSVN:
This client is useful if you like tight integration with Windows. It shows up in the context menus and is very easy to work with.
http://tortoisesvn.tigris.org/


TortoiseSVN Screenshot
 

WebSVN:
A more refined web interface to svn, compared with the one provided using the initial setup.
http://agilior.pt/blogs/pedro.rainho/archive/2010/02/06/11698.aspx


WebSVN Screenshot
 

SVN on Hostmonster (or other hosts with blocked svn port, but SSH access):
http://hostmonsterforum.com/showthread.php?1294-Subversion

This article was orginally posted on Jason’s Computer Science Blog.

Mar 06 2011

View Any Text in All of Your Available Fonts at the Same Time

Posted by admin in Computers

Thousands of fonts are freely available throughout the Internet. Most of us have acquired font collections that number well into the hundreds. Yet, even with all of these fonts, finding the right one for our projects requires typing our text, then scrolling through and selecting font after font until we happen to hit the right one.

WordMark.it has a solution to this computer-age old problem.

logo

To see a word or group of words in all of your available fonts, highlight wordmark and type your own word or phrase.

word

Click the load fonts button. It will turn green as your mouse rolls over it.

load fonts

Within a few seconds, your chosen text is displayed in every one of the installed fonts on your computer. Scroll down to see all of your font options.

font options

To see the text displayed as white on black background, click the negative link at the top of the screen.

negative

Click the smaller or bigger links at the top of the screen to resize the text.

smaller bigger

To compare font styles side-by-side, select a few font options from your list by clicking on them, then click filter selected at the top of the screen.

filter

WordMark.it is a great way to find the perfect font style for a word or phrase. The site loads quickly, and the font styles are accurate depictions. We like being able to compare our favorites side-by-side for final decision making with the filter selected tool. WordMark.it is definitely worth a bookmark for those times when finding the right font is imperative.


Copyright © 2007
Online Tech Tips.
Aseem Kishore (digitalfingerprint: a59a56dce36427d83e23b501579944fcakmk1980 (74.125.94.84) )

Post from:

View Any Text in All of Your Available Fonts at the Same Time


This article was orginally posted on Online Tech Tips.

Mar 01 2011

Use Google Cloud Connect to Share and Backup Microsoft Office Files

Posted by admin in Computers

Google Docs is one of the most popular ways to share and collaborate with others on documents. However, the service often feels clunky, and lacks many of our favorite Microsoft Office features.

Google Cloud Connect fixes this problem. Cloud Connect is a plugin for MS Office that automatically syncs Office files with an online backup, care of Google Docs.

logo

Cloud Connect works with Office 2003, 2007 and 2010, and Windows XP, .NET, Vista and Windows 7. To use the service, you must have a Google account.

To start using cloud connect, click the blue download link on the left of the Cloud Connect page.

download

After accepting Google’s terms, the plugin’s installation takes about a minute. A message will appear when the installation is complete. Open Word, Excel or PowerPoint.

Across the top of the screen, just below the ribbon, you will see a message from Google Cloud Connect. Click Login and enter your Google account name and password.

login

Decide if you want the application to sync your files automatically with online backups, or if you would prefer to do so manually and click OK.

choose

Save your file just as you normally would. After you do, Cloud Share updates to show a direct URL to your document.

url

Clicking the link will display the file in Google Docs with the option to download it. To share the document with friends, click the Share button on the far right of the Word, Excel or PowerPoint screen.

share

A settings menu will appear. From here, you can designate people with whom to share the file. You can also give other people permission to revise the file.

share settings

Giving someone else permission to revise the file is one of the best features of Cloud Connect. If the other person has the Cloud Connect plugin installed, you can both edit the file at the same time, with each of your revisions showing on the other person’s screen each time you save.

kim and bob

The Google Cloud Connect plugin definitely makes Google Docs more useful. It streamlines the process of backing up files in the cloud, which we like. However, the plugin is meeting mixed reviews.

Microsoft reports privacy issues and lost features with Cloud Connect. With MS Word, we did not experience any lost features, but we did notice our theme changed slightly in our PowerPoint test.

Since the service is new, it probably has a few bugs to work out yet. For now, we are hopeful of Cloud Connect’s success.


Copyright © 2007
Online Tech Tips.
Aseem Kishore (digitalfingerprint: a59a56dce36427d83e23b501579944fcakmk1980 (74.125.94.88) )

Post from:

Use Google Cloud Connect to Share and Backup Microsoft Office Files


This article was orginally posted on Online Tech Tips.

Feb 28 2011

WordPress Tutorial: Featured Images

Posted by admin in Computers

This is a quick tutorial on how to get out featured images, which I use extensively on this blog (jasonernst.com). The featured image is what shows on the home page for the site, and on the individual entries. In the event that there is no featured image set for a given post, a default image is displayed instead.


An example of a featured image

For reference, I know this has worked since at least WordPress 3.0, but it may work with some earlier versions as well (I think earliest may be WP 2.9). This tutorial assumes you have some knowledge of how to work with php files, and have a basic idea of how WP templates work.

Step 1: Thumbnail Sizes
You may wish to have some different thumbnail sizes from the usual ones which WordPress generates automatically. You can change this in Settings->Media and adjust the sizes to your liking. This will allow you to control the large, medium and thumbnail sizes.

Since WordPress 2.9, you can actually create your own image sizes and names using the add_image_size function. You can just add this into your functions.php file within your template. For example, my featured post thumbnail size is 240×150 and I want the image to be cropped from the original (rather than stretched weirdly).

 

This is what I added to my functions.php (note the check for the function, so that we don’t break older WP versions):

if (function_exists('add_theme_support')) {
  add_image_size('featured-thumbnail', 240, 150, true);
}

Step 2: Customize the template
Here we check if there are any thumbnails generated, and if not display the default image. You could also do other things, such as display nothing, or ignore the post altogether if there is no thumbnail image. This is an example of the main thumbnail I use for my featured article on my home page (in my home.php template file). If there is no featured image set for the post, it displays a default image found in the template’s “img” folder. Note: this is done within “the loop”.

$postthumbnail = get_the_post_thumbnail($post->ID, 'single-post-thumbnail');
if(!isset($postthumbnail) || $postthumbnail == "")
  $postthumbnail = '<img src="'.get_bloginfo('stylesheet_directory').'/img/default.jpg" alt="'. get_the_title() .'"/>';

Step 3: Add the thumbnail images to the posts


Click the featured image link to set an image as the featured image

This is the easy part, all you have to do is upload some images to the library. After the image you want is in the library you can select is using the “show” link and then use the link to select “set as featured image”. You should now see it show up in your template.

One last note, a useful plugin…especially when you are still working out the sizes of your images is the WordPress Regenerate Thumbnails plugin. It will regenerate all of the images to the new size you have specified.

This article was orginally posted on Jason’s Computer Science Blog.

Feb 22 2011

Uninstall Internet Explorer 8 in Windows XP and Vista

Posted by admin in Computers

Internet Explorer 8 has many new and useful features. However, in some instances, upgrading to Internet Explorer 8 may still cause problems with your Web browsing. To solve these problems you can uninstall Internet Explorer 8 from your computer.

Uninstalling Internet Explorer 8 in Windows XP or Vista will roll Internet Explorer back to its previous version and restore its settings. To uninstall Windows Internet Explorer 8, you must be logged into your computer as an administrator. Close all open programs before continuing.

Windows XP

Internet Explorer 8 can only be uninstalled if you installed it after installing Windows XP Service Pack 3. If you installed Internet Explorer 8 before installing the SP3 update, you must uninstall SP3 before uninstalling Internet Explorer.

To do this, click Start and Control Panel. Select Add or Remove Programs. Click Show Updates. Select Windows XP Service Pack 3 and click Remove.

Uninstall Windows XP SP 3

To uninstall Internet Explorer 8, scroll down the list of installed programs in the Add or Remove Programs list. Select Internet Explorer 8 and click Remove.

Uninstall IE 8 in XP

Windows Vista

Click Start, then Control Panel. Under Programs, select Uninstall a program. Under Tasks on the left side of the screen, select View installed updates. Scroll down and select Windows Internet Explorer 8. Click Uninstall, then click Yes. Restart your computer when uninstallation is complete.

Uninstall IE 8 in Vista

If Internet Explorer Won’t Uninstall

If these steps don’t work to remove Internet Explorer 8 from your computer, and it was very recently installed, you can uninstall it using the System Restore utility. In Windows XP, you can find System Restore under System Tools in Accessories. Select Restore my computer to an earlier time and click Next.

System Restore Windows XP

To start System Restore in Windows Vista, type System Restore in the Start Search box and select the utility under Programs. Select either Recommended restore or Choose a different restore point, depending on when you installed Internet Explorer 8 .

System Restore Vista

If you still can’t uninstall Internet Explorer 8, you can disable it as your default browser. Make sure to install another browser before trying these steps.

In Windows XP, open the web browser you would like to use from now on. When the new web browser prompts you, set it as your default browser. If it doesn’t prompt you, navigate the new browser’s menus to set it as your default browser. For example, in Firefox, select Tools, Options and Advanced. Select the check box next to Always check to see if Firefox is the default browser on startup, or click the Check Now button.

Firefox Default Browser

In Windows Vista, click Start and Default Programs. Click Set Your Default Programs. Select the web browser you would like to use from the Programs window. Click Set this program as default. Also click Internet Explorer and Choose defaults for this program. Ensure that all the boxes are unchecked and click Save.

Default Programs Windows Vista and 7

For more information on this topic, read Uninstall Internet Explorer 8 in Windows 7.


Copyright © 2007
Online Tech Tips.
Aseem Kishore (digitalfingerprint: a59a56dce36427d83e23b501579944fcakmk1980 (209.85.224.89) )

Post from:

Uninstall Internet Explorer 8 in Windows XP and Vista


This article was orginally posted on Online Tech Tips.

Feb 22 2011

Sharethis WordPress Plugin – Invalid XHTML

Posted by admin in Computers

Building on my previous post regarding invalid XHTML (Version 1.0 Strict), I have been trying to find out why my site has not been validating. It turns out, the last bit of the problem is the “Sharethis” plugin for WordPress. In this plugin, the authors decided to define some custom parameter fields within the ‘span’ tag causing the validation problems. A post here indicates it is for “simplicity” for their less technically inclined users. So, this post is to show you how to modify the plugin to get valid XHTML out of it instead.

In the sharethis.php file, the offending lines are here:

$tags="<span class='st_sharethis' st_title='".strip_tags(get_the_title())."' st_url='".get_permalink($post->ID)."' displayText='ShareThis'></span>";
$tags.="<span class='st_".$svc."_vcount' st_title='Sharethis WordPress Plugin – Invalid XHTML' st_url='{url}' displayText='share'></span>";

And here are the updated lines:

$tags="<span class='st_sharethis'></span>";
$tags.="<span class='st_".$svc."_vcount'></span>";

In this case, disabling the extra fields means that the “sharethis” text and some minor styling disappear from the sharethis button. It seems the easiest way to have compliant XHTML and still a decent looking sharethis button is to use the a custom button style (see this page).

So the result is this:

$tags="<span class='st_sharethis_custom'><a rel="nofollow" href=''>ShareThis</a></span>";
$tags.="<span class='st_sharethis_custom'><a rel="nofollow" href=''>ShareThis</a></span>";

The ‘ShareThis’ text is enclosed in an “a” tag so that we get the mouseover behaviour and link styling that it had previously. Additionally, the css file for your template must be changed. This is what I added to mine to make it work:

.st_sharethis_custom { background: url("img/sharethis.png") no-repeat scroll left top transparent; padding-left: 18px; padding-top:3px;}

You will want to change the url to wherever you have located the sharethis icon, and the padding and margins may need to be adjusted for your own template.

This article was orginally posted on Jason’s Computer Science Blog.

Feb 20 2011

Customize Your Android Homescreen

Posted by admin in Computers

When using one of the many variations of Android on your smartphone (i.e. Droid, Galaxy S, HTC, etc.) you have the ability to highly customize your home screens with widgets, shortcuts and apps. While every Android phone is slightly different when it comes to what widgets are available, they are customized using the same method.

There are also many third-party apps and “widgets” you can place on your home screen that can be found in the Android “Market,” Google’s version of an “App Store.” This very open and customized experience has made Android one of the most popular smartphone operating systems to date.

To customize your home screen, swipe left or right on your phone to find a screen with some open space. Depending on which Android phone you have, there may be 3, 5 or even 7 home screens to swipe through.

Home

Once you’ve found a home screen with empty space, press your finger in the open area and hold it there for two to three seconds. A new menu will appear and you can release the screen.

Menu

This new menu gives you several options to choose from. Tapping on the Shortcuts button will allow you to create a home screen icon that takes you directly to a specific application, web browsing bookmark, contact, mail inbox, music playlist, or several different options as well. This is a helpful way to create a speed dial icon right on your home screen.

Shortcuts

Tap on Widgets to bring up a new menu of active home screen widgets that you can place anywhere on your phone. These widgets are more than shortcuts to an application, they are live “windows” that you can interact with right on your phone. The Facebook widget for instance, allows you to post a status and see your friends posts right on the home screen without opening the app.

Widgets

Selecting the Folder option includes phone number shortcuts, starred contacts, or create a folder to place several app shortcuts.

Folder

Once you’ve placed icons and widgets on your home screens, you can move or delete them at will. Tap and hold on an icon or widget to edit its location.

Move Icon

If you want to remove an icon or widget, hold your finger on the item and drag it to the bottom of the screen where it says Remove.

Remove Icon

If you’re trying to move an icon or widget to a home screen that is already full, you will see an error message at the top of the screen saying there is No space on this screen.

No Space

While dragging the item, you will also see a colored outline letting you know how large of a space is needed for that shortcut.


Copyright © 2007
Online Tech Tips.
Aseem Kishore (digitalfingerprint: a59a56dce36427d83e23b501579944fcakmk1980 (74.125.94.85) )

Post from:

Customize Your Android Homescreen


This article was orginally posted on Online Tech Tips.

Feb 11 2011

BitPim User’s Guide – What You Need to Get Started

Posted by admin in Computers

Although smart phones such as the iPhone, Motorola Droid, Blackberry Bold, etc., have quickly become the most popular mobile devices, some cell phone users still prefer simplicity over apps. Many cell phone users just don’t have a need for all of the fancy features that smart phones offer. Rather, they make calls, text, and that’s about it.

One advantage of smart phones is that they have the ability to add ringtones, wallpapers, YouTube videos, or just about anything else you would like, simply by using an app… The easy way. But how do you add ringtones, wallpapers, and other cool stuff to a normal cell phone? That’s what BitPim is for.

iPhones

Well, BitPim will work for many smart phone/high-end phones as well; but most likely, you will not need to use BitPim for those phones, as there is an app for that.

The normal way to get a ringtone for a cell phone is to pay a fee of a couple of dollars to your carrier, and simply download the ringtone to your cell. Although this is the most convenient way to get ringtones, it does hold several limitations.

For example, many ringtones are censored for profanity. Also, you can only choose from ringtones that your carrier offers. Chances are, they may not have a ringtone available for the song you are looking for.

Yet another disadvantage of cell phone service provider ringtones is that they are non customizable. The song clip to be used for the ringtone is already selected, you cannot always have your favorite verse of a song.

VZW Media Store

BitPim allows you to create your own ringtones out of any song. You can choose which portion of the song to use for the tone as well. Here are some things you will need to get started:

  • The latest version of BitPim.
  • A USB to Phone Transfer Cable.
  • An MP3 song (to be used for ringtone).
  • An image (to be used for background).

Chances are, you have access to everything above except for the USB to phone transfer cable. You can find these for your specific phone on eBay for approximately $3.00. If you want to get started ASAP, you can head down to your local AT&T, Verizon, T-Mobile, etc., and they should have them for sale.

VZW Music Essentials Kit

Another thing that should be mentioned, BitPim can mess up your phone’s firmware. BitPim is a program that is capable of doing much more than just adding ringtones and wallpapers. If you go through and delete files that you shouldn’t, this could render your phone unusable.

Thus, we will not be responsible for anything that happens. However, I would still recommend that you try out this tutorial, as BitPim is a very cool program once you learn how to use it. With a little common sense, you should have nothing to worry about.

Once you have BitPim installed on your computer, go ahead and launch it to get started.

*Another item that should be addressed right now, some users have reported problems with installing BitPim under Windows 7 and Vista. BitPim does officially support Windows 7 and Vista.

However, trying to run BitPim may give you an error stating that a certain msvcp71.dll file is missing. To fix this error, you may need to download this file, and move it to the directory Start > Computer > C: > Program Files (X86) > BitPim.

All of that preparation and we still haven’t added a ringtone yet! Well, it’s definitely worth it once you learn BitPim and get it up and running. Be sure to proceed on to part 2 of our BitPim User’s Guide where you can get started adding ringtones, wallpapers, and more.


Copyright © 2007
Online Tech Tips.
Aseem Kishore (digitalfingerprint: a59a56dce36427d83e23b501579944fcakmk1980 (74.125.94.89) )

Post from:

BitPim User’s Guide – What You Need to Get Started


This article was orginally posted on Online Tech Tips.

Feb 08 2011

Points to consider for Usage Based Billing (UBB) in Canada

Posted by admin in Computers

While I make no claims to understand the economics of the agreements between ISPs for forwarding traffic between each other, the point of this article is to provide a unique perspective since I am a graduate student in the networking field. I also briefly outline some potential techniques that could improve the situation (although none can really solve the problem of the alleged gap forming between revenue and expense). My personal opinion is against UBB since I believe it is against innovation and will make Canada less competitive. Charging per-byte rates will become far too expensive for many people to use the Internet in the same way as people in other countries (or those people with lots of extra money). It will result in contributing to the gap between have and have-nots where poorer people in the country are excluded from the same access to content and opportunity that others have. I try not to focus on arguing for UBB in this article because there are several existing articles which argue this quite well. (Financial Post The Globe and Mail).

In May of 2010, I attended an IEEE conference called the International Communications Conference (ICC 2010) in Capetown, South Africa. This conference is considered the one of the top conferences by the IEEE communications society and is attended by many experts in the communications field. I found one of the keynote speeches by Dr. Steven D. Gray, Head & Vice President Corporate Research, Huawei Technologies to be especially relevant to the current debate in Canada over usage based billing (UBB). The keynote is available free online from the IEEE ComSoc (please note, the keynote I am referencing here starts at about 51 minutes in the presentation).

While the key point about profitability deals with wireless carriers, it may also be relevant to wired network providers. Especially in Canada for the following reasons:

  1. The vast, sparse country which must be connected
  2. The constant upgrades to equipment required
  3. The limited capabilities of backbone and infrastructure networks & increasing speeds of user connections
  4. Steady growth in traffic from users

1. The vast, sparse country which must be connected

Compared to other countries in the world, Canada is very sparse. According to a Wikipedia article surveying population density around the world, Canada places 228 in the world. According to this figure (from Gizmodo), Canada ranks 8th in the world for average broadband speeds. Compared with the USA, which ranks 15th (and has a population density almost 10 times higher than Canada), we have less than twice the average speed for roughly the double the cost. Considering our low density and similar geographic size, one would expect we would pay much more.

Map of the Internet [http://www.opte.org/maps/]

2. The constant upgrades to equipment required

The communications industry is constantly evolving as engineers and scientists figure out how to make faster connections or find new ways to communicate (for example, 10 mbps ethernet to 100 mbps to gigabit and beyond), (example 2: Ethernet to fibre optic, or even next generation wireless networks). Every time something new comes out or improvements are made, the companies must put money into making it work with what they already have, deploy new equipment and so forth. Often because the networks are becoming more complex it requires hiring more people to manage them (which may eventually be solved by autonomous networking, but that’s a different story).

Another example of expense to keep up to date in Canada is Bell Canada. Many people with Bell Internet also have wireless access points provided by Bell. Unfortunately, these access points default to (or in some cases only support) WEP encryption. This encryption is not secure at all and can be broken by your average teenager with instruction off youtube. However it could be argued in hindsight this type of expense is the company’s fault.

Furthermore, to increase capacity in the network, it is not as simple as just adding another link between an under-supplied area. Consider a small town where a few people make use of the majority of the connection cause poor performance for the others in the town. This town may be a candidate for increased capacity, but by adding another connection the company does not stand to gain any increase in subscribers and thus may stand to lose money. Now expand this example to larger cities where higher and higher proportions of the population are using more and more of their connection to the point where almost everyone is straining the infrastructure. There are solutions to this type of problem though. Some companies in the US and other places make use of traffic shaping (which while unpopular is a cheaper alternative to the user). Perhaps two types of plans could be put in place, one with traffic shaping and unlimited usage, or one with no traffic shaping and limited usage.

3. The limited capabilities of backbone and infrastructure networks & increasing speeds of user connections

One of the problems with the increased cost to the providers is the increased speed of user connections. Allowing users to have faster connections means they can request more information at once. Imagine many people flushing their toilets at the same time where the pipe at the road isnt big enough to handle all of the water at once. This is what has been allowed to happen. The problem is further compounded because it is not as simple as water simply flowing through pipes. At each junction, decisions must be made on the direction of the flow. If too much traffic arrives at once junction, the time it takes to make a decision is slower than the rate new traffic is appearing and big problems happen.

4. Steady growth in traffic from users

As can be seen in some of the figures in the ICC keynote, traffic from users is growing exponentially. Unfortunately, the service providers’ revenue is usually growing linearly, so there is eventually a point where it is not profitable for the companies to provide Internet service (assuming the cost to provide exponential traffic grows exponentially). This is the most compelling point for usage based-billing. Unless we can somehow find a way to reduce the growth of data, the only way to retain profitable ISPs is to increase the revenue.

Internet growth [Cisco]

5. Conflicting interests between user service and shareholders profits & the disconnect between what you get and what is advertised

This is another important problem with ISPs. Perhaps this is the reason that the infrastructure managed to get into its current state (where it cannot handle everyone making full use of their advertised connections). In order to gain a competitive advantage over competing ISPs, each company often advertises their maximum potential connection speeds. There is never any mention of the network past the point where your house connects to the ISP. Sure if no one else in your neighbourhood is using the connection you might get close to the advertised speed, but as many people know, you often don’t get close. From the shareholder point of view, you want the company to spend as little as possible on infrastructure. Perhaps it may be necessary the enforce a rule that companies must be able to provide the full advertised speed, regardless of how many other people are on the network. Of course, this would make the Internet much more expensive.

6. Potential Solutions instead of UBB

There are many promising technical solutions to some of the problems that are causing the gap between cost and revenue in Internet technologies, however many of them may not make enough of an impact, or are still too premature to cause a difference yet. So in the meantime something must be done.

In the case of providing video services or other multimedia streaming services such as Netflix, LastFM etc. technologies such as multi-casting may be used to deliver common data to a group of users with one packet (in the unicast model, one packet is sent over and over again for every user, even if they are watching the same content).

To reduce the cost of human maintenance and oversight over the networks, applying autonomic computing techniques to networks so that they can self-manage, self-protect etc. may be beneficial.

Exploiting peer-to-peer, caching and other technologies that reduce communications over the large distances on the Internet may help reduce the cost of delivering traffic on the Internet.

Providing tiered Internet service, where users pay for different service levels may be another model altogether that allows companies to remain competitive without usage based billing. Make traffic that causes high strain on the networks (such as streaming video, real-time traffic etc.) more expensive than traffic that is delay tolerant and has lower requirements (web, email etc.)

Perhaps the government itself should take a more active role in providing Internet infrastructure in Canada if the Internet is seen as another piece of infrastructure like roads, bridges and electricity.

Concluding remarks

Of course, there are many assumptions to the case for UBB. The assumption that the cost for service providers is growing exponentially is the biggest and most important. Wired network access doesn’t have the same problems wireless has (the broadcast, limited bandwidth medium, interference etc.) so the comparisons may not actually be valid. The case becomes complicated by the fact that many ISPs are also in the business of providing wireless service, media services (tv, radio, newspaper etc.) that causes conflicts of interest.

The trouble I have with charging the heaviest users is that everyone seems to be trending towards using more and more traffic. In my own experience with large ISPs I feel like I’m always getting less for more money (usage caps have been getting lower and lower, yet the bill keeps going up). The advertised speeds of the networks are going up, but the capacity seems to be falling since we can get more faster, but less overall.

This article was orginally posted on Jason’s Computer Science Blog.

Jan 30 2011

Could Not Open Socket reCAPTCHA Error

Posted by A R Chalmers in Computers

After months of receiving spam through my contact forms I decided it was time to add reCAPTCHA to them in the hope of stemming the tide of garbage.  This now under the control of Google I thought there wasn’t going to be an issue with this. Having just installed reCAPTCHA on my works websites I knew what to do and all went well on those sites. On the Friday I did 3 forms on my own sites and all worked as expected, on the Saturday I did the last form I had, but that one didn’t work. All I kept getting was a ‘could not open socket’ error.

Initially I thought I must have made some error in the code but after checking the code against that which I had done the day before I could see no error. And more over the 3 forms I did the day before that worked, now no longer worked and displayed the same error message, what the hell?? Most frustrating was the fact that this was all the message said and gave no clue as to what was causing it. I made a number of attempts to find which section of code that was at fault by adding echo’s throughout the php code but none of them showed, only that damned error message. I thought there must be something wrong with the server.

Someone must have had this issue before so I turned my attention to Google for an answer. As I started to type ‘could not open socket’ the autocomplete came up with ‘could not open socket recaptcha’, ah ha! But I couldn’t think why it could have worked yesterday and not today? After reading many unhelpful posts’ I found this: http://code.google.com/p/recaptcha/issues/detail?id=26 which although didn’t have the exact answer it did help me to realise the answers to my own issues.

After reading through this thread I came to the conclusion that my problem was 2 fold and explained why it had worked yesterday and not today. The main problem was my web host, in their attempt to be helpful they introduced (a long time back) blocking of outgoing connections to remote IPs from within my sites. This is one to be aware of if you are auto blogging using wp-o-matic, any feed you add will most likely be blocked by this until you add the IP to the allowed list from within your control panel.

I assume there is a good reason for them doing this but it can imagine it has caused nightmares for the inexperienced. Obviously it had worked yesterday because it was new, once the server knew the connection was being made it blocked it. It was probably the number of tests I did that made the connection get noticed and was possibly a good job it was noticed so quickly or I might not have noticed it for some time.

So which IP was I to add to the allowed list? The line of code in recaptchalib.php identified as the problem in the above thread was:

define(“RECAPTCHA_VERIFY_SERVER”, www.google.com);

So what I needed was the IP of google.com. http://www.mxtoolbox.com/SuperTool.aspx is a very useful tool I have been using for a long time. A DNS lookup for google.com gave me 5 options for an IP, 74.125.227.48 to 74.125.227.52, so now I have:

define(“RECAPTCHA_VERIFY_SERVER”, “74.125.227.48″);

Adding this IP to the allowed remote IP list from within my control panel sorted the problem on all my forms. Score!