<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>A2B and More</title>
	<link>http://blog.a2b.cc</link>
	<description>Sam Critchley - A2B and much more</description>
	<pubDate>Fri, 07 Apr 2006 21:19:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>
	<language>en</language>
			<item>
		<title>A2B makes front page of Reuters.com</title>
		<link>http://blog.a2b.cc/?p=132</link>
		<comments>http://blog.a2b.cc/?p=132#comments</comments>
		<pubDate>Fri, 07 Apr 2006 21:18:43 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>A2B</category>
	<category>techie</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=132</guid>
		<description><![CDATA[Thanks to a great article by Amsterdam-based correspondent Niclas Mika, A2B has made the front page of reuters.com (click on the &#8220;Phones that find you&#8221; link on the right hand side).
You can view the whole article here:
http://today.reuters.com/news/newsArticle.aspx?type=technologyNews&#038;storyID=2006-04-07T181554Z_01_N07376126_RTRUKOC_0_US-COLUMN-PLUGGEDIN.xml&#038;src=cms
There are some great quotes in there about how the future looks as mobile phones, ubiquitous (unmetered) internet connectivity [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to a great article by Amsterdam-based correspondent Niclas Mika, <a href="http://www.a2b.cc">A2B</a> has made the front page of reuters.com (click on the &#8220;Phones that find you&#8221; link on the right hand side).</p>
<p>You can view the whole article here:</p>
<p><a href="http://today.reuters.com/news/newsArticle.aspx?type=technologyNews&#038;storyID=2006-04-07T181554Z_01_N07376126_RTRUKOC_0_US-COLUMN-PLUGGEDIN.xml&#038;src=cms">http://today.reuters.com/news/newsArticle.aspx?type=technologyNews&#038;storyID=2006-04-07T181554Z_01_N07376126_RTRUKOC_0_US-COLUMN-PLUGGEDIN.xml&#038;src=cms</a></p>
<p>There are some great quotes in there about how the future looks as mobile phones, ubiquitous (unmetered) internet connectivity and GPS converge, plus Niclas is the first person who seems to have noticed that my A2B business card has a latitude and longitude instead of a normal address on it. <img src='http://blog.a2b.cc/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=132</wfw:commentRSS>
		</item>
		<item>
		<title>Now blocking 442 splog servers</title>
		<link>http://blog.a2b.cc/?p=130</link>
		<comments>http://blog.a2b.cc/?p=130#comments</comments>
		<pubDate>Mon, 30 Jan 2006 18:01:46 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>techie</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=130</guid>
		<description><![CDATA[We are now blocking 442 web servers - 73,592 splog URLs in all!]]></description>
			<content:encoded><![CDATA[<p>We are now blocking any ping from URLs which resolve to one of <strong>442</strong> web servers. That&#8217;s a total of 73,592 splog URLs in all. Check out the <a href="http://www.a2b.cc/pingblock">latest list</a>.</p>
<p>In my opinion, this means that splogs are big business and the spammers are making a lot of money out of them. Four hundred and forty-two dedicated web servers afterall! These machines aren&#8217;t doing anything else (as far as we can tell) but hosting splog sites and sending out pings for them.</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=130</wfw:commentRSS>
		</item>
		<item>
		<title>Number of pings (and splog URLs) dropping</title>
		<link>http://blog.a2b.cc/?p=129</link>
		<comments>http://blog.a2b.cc/?p=129#comments</comments>
		<pubDate>Thu, 26 Jan 2006 17:23:53 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>techie</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=129</guid>
		<description><![CDATA[Since we introduced our splog blocklist the number of pings we're receiving is dropping]]></description>
			<content:encoded><![CDATA[<p>Since we introduced our <a href="http://www.a2b.cc/pingblock/">splog blocklist</a> and <a href="http://spamhuntress.com/">Spam Huntress</a> posted about it, both i) the amount of traffic we waste and ii) the number of pings we are receiving have dropped. At the moment we&#8217;re not quite sure why the second one has happened, but we think that either one of our XML-RPC ping sources (<a href="http://pingomatic.com/">pingomatic.com</a>  being the biggest) has started filtering as well, or else one of the big blog hosting sites has started blocking splogs. Anyway, it&#8217;s all good news.</p>
<p>We now have 370 web server IP addresses in our blocklist. Yesterday we received 474,394 pings of which 161,094  were blocked immediately based on the web server being on the blocklist. Of the rest, 179,467 were picked up by our incremental &#8220;delay buffer&#8221; which means we won&#8217;t go out and index them for up to 8 days if we get another ping for the same URL. </p>
<p>Here&#8217;s a rough explanation of how our splog blocklist works. I already posted this text as a comment to a Spam Huntress <a href="http://spamhuntress.com/2005/12/31/suss-out-spam-networks/">post</a> a while ago:</p>
<blockquote><p>At A2B (see <a href="http://www.a2b.cc">http://www.a2b.cc</a> for more) we run a search engine with a ping interface. Bloggers who have geo-located META tags in their HTML (see <a href="http://www.a2b.cc/help-searching-addurl-blogping.a2b">http://www.a2b.cc/help-searching-addurl-blogping.a2b</a> for more) can ping us and we’ll pick up (parse) their page and index it in our geosearch engine. We receive pings from many individual bloggers, a full ping feed from pingomatic.com, and bulk pings from several other sources, usually around 700,000 to 1 million pings per days. With approximately 200 IP addresses in the blocklist, about 37% of daily pings are blocked immediately.</p>
<p>To generate the list, we recorded the URL of each website (read blog) we were pinged with and also converted it into the IP address of the web server for each URL. We recorded the IP address and added to a counter every time we received a ping for a URL on the same web server. We soon noticed that we were getting many thousands of pings for the same IP addresses, so pulled a script together to list the top IP addresses by number of pings.</p>
<p>We built another script which showed all the URLs associated with each IP address. In order to decide which web server IP addresses are serving splogs, which we block, we open this script and manually have a look at a random sampling of the URLs - it’s usually pretty easy to tell if they’re splogs as they’re just full of advertising links or are quite random in their choice of subject matter. Any web server which has real blogs tends to stay off the blocklist (so that rules out blogspot.com even though people are using it for splogging).</p>
<p>As soon as we’d blocked the first 112 IP addresses, the amount of traffic we were using parsing blogs dropped from 27GB per day (it was so high that it was costing us money in hosting charges) to 6GB/day. Of course, it began to creep up again soon after, so we’re realising it’s an ongoing effort and are beginning to think about blocking whole ranges of IP addresses.</p></blockquote>
<p>Hope that&#8217;s of interest to everyone.</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=129</wfw:commentRSS>
		</item>
		<item>
		<title>A2B blocklist makes it to Spam Huntress</title>
		<link>http://blog.a2b.cc/?p=128</link>
		<comments>http://blog.a2b.cc/?p=128#comments</comments>
		<pubDate>Mon, 02 Jan 2006 22:45:50 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>A2B</category>
	<category>techie</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=128</guid>
		<description><![CDATA[Norwegian anti-spam goddess Spam Huntress gives our list a mention]]></description>
			<content:encoded><![CDATA[<p><a href="http://spamhuntress.com/">Spam Huntress</a> Ann Elisabeth has given our splog <a href="http://www.a2b.cc/pingblock/">blocklist</a> a <a href="http://spamhuntress.com/2005/12/31/suss-out-spam-networks/">mention</a> on her blog. Thanks Ann Elisabeth! I left a comment explaining how we put the list together.</p>
<p>Ann Elisabeth also pointed out that we&#8217;d forgotten to put &#8220;nofollow&#8221; tags on the links to the splog URLs. We&#8217;ve now fixed it. Thanks again!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=128</wfw:commentRSS>
		</item>
		<item>
		<title>Fighting XML-RPC blog ping spam</title>
		<link>http://blog.a2b.cc/?p=127</link>
		<comments>http://blog.a2b.cc/?p=127#comments</comments>
		<pubDate>Tue, 20 Dec 2005 23:27:57 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>techie</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=127</guid>
		<description><![CDATA[At A2B we've got a problem with huge quantities of bogus blog URLs coming in via our XML-RPC  ping interface. Here's how we're solving it.]]></description>
			<content:encoded><![CDATA[<p>As regular users of <a href="http://www.a2b.cc">A2B</a> (and readers of this blog) will know, we run an XML-RPC &#8220;ping&#8221; interface for bloggers. The idea is that bloggers post an entry to their blog and their blog software or service automatically notifies us of the update in the background. In our case, we then go out and parse the URL of the blog entry for <a href="http://www.a2b.cc/help-searching-addurl-blogping.a2b">geographical metadata</a>. If we find it, we add the site to A2B so it&#8217;s searchable via our website and GPS software such as <a href="http://www.a2b.cc/software.a2b">GPSCookie</a> and <a href="http://www.tinystocks.com/gps.html">Navio</a>. Most of our pings come in via ping aggregator services such as <a href="http://pingomatic.com">Pingomatic</a> - we now receive about 700,000 to 1 million pings a day.</p>
<p>Recently the number of pings and the number of new URLs had been shooting up every day, presenting us with a problem. Because we go out and parse every new URL, we had been generating an average of about 27 GB of traffic a day (yes, that&#8217;s twenty-seven <em>gigabytes</em>). Time for some action.</p>
<p>A couple of months ago we&#8217;d already introduced a system where we wouldn&#8217;t parse a URL again for a while if the first pass didn&#8217;t contain geographical meta information, and this had reduced our traffic somewhat initially, but it was back up and climbing fast. We ran some analysis, and found out that a huge proportion of the URLs we were getting pings for turned out to be autogenerated spam blogs - endless variations on &#8220;Real Estate in Florida News Blog&#8221; and &#8220;Hair Loss Removal Therapy in Seattle Blog&#8221; and other typical spammer themes. We discovered that many of these URLs seemed to be resolving to a smallish number of web servers set up specifically for hosting spam blogs. Time to block some IP addresses!</p>
<p>We came up with a <a href="http://www.a2b.cc/pingblock/">blacklist of banned IP addresses</a>, based on which web servers the largest numbers of received ping URLs resolved to, and wrote a script blocking anything matching those IP addresses. We banned 114 IP addresses, and our traffic dropped immediately from 27 GB per day to 6 GB! Result! One in the eye for blog spammers! At least on A2B anyway&#8230;. You can check out which IP addresses we banned, how many pings we&#8217;re getting for each web server, and which URLs they&#8217;re sending us, <a href="http://www.a2b.cc/pingblock/">here</a>.</p>
<p>Now we&#8217;ve got a list of most popular web server addresses each day and we&#8217;re adding to the blocked list all the time! But it&#8217;s a struggle as the spammers are constantly changing IP addresses and their exact system is difficult to figure out.</p>
<p>Perhaps the most interesting thing is that we&#8217;ve had to ban the web server that Loic Lemeur&#8217;s <a href="http://www.loiclemeur.com/english/">English blog</a> sits on. He&#8217;s the founder of <a href="http://www.typepad.com">Typepad</a> and runs the <a href="http://lesblogs.typepad.com/">Les Blogs</a> conferences! The server only holds a few URLs in our database, they all seem to be spam apart from his, and we were getting a lot of pings resolving to it. Does he have friends who are blog spammers? I can&#8217;t imagine so, but lots of the URLs are typepad.com domain names.</p>
<p>****<br />
Update - I have just found out these spam blogs are called <a href="http://www.micropersuasion.com/2005/12/study_says_75_o.html">splogs</a> - we&#8217;re now <a href="http://www.blogmaverick.com/entry/1234000717063627/">fighting splogs</a>!</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=127</wfw:commentRSS>
		</item>
		<item>
		<title>Customising the look and feel of  the Opera browser</title>
		<link>http://blog.a2b.cc/?p=126</link>
		<comments>http://blog.a2b.cc/?p=126#comments</comments>
		<pubDate>Mon, 28 Nov 2005 13:44:16 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>techie</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=126</guid>
		<description><![CDATA[I&#8217;ve been using Opera as my main browser for about 3 or four years now - in fact I&#8217;ve got it running on my Nokia 6600 phone as well as my Windows PC. I really like it as a browser - independent, lots of features, great forums where people actually take the time to respond [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://www.opera.com">Opera</a> as my main browser for about 3 or four years now - in fact I&#8217;ve got it running on my Nokia 6600 phone as well as my Windows PC. I really like it as a browser - independent, lots of features, great <a href="http://my.opera.com/community/forums/">forums</a> where people actually take the time to respond to your comments, and it seems much less vulnerable to security scares experienced by browsers such as Internet Explorer and Firefox.</p>
<p>Setting up Opera as a first-time user can be a slightly intimidating experience - almost every single aspect of the look, feel and background workings of the browser is configurable, and it can take ages to work out how to customise  (customize, whatever) it so that it is as useful as possible. Recently, I&#8217;ve had a few newer users ask me how I got Opera working well. I put together a few tips for one of them - I hope they&#8217;re useful:</p>
<ul>
<strong>Appearance</strong></ul>
<p>- IMO the best way to customise the look/feel of the browser is by right-clicking on one of the toolbars and selecting &#8220;customize&#8221; to get the Appearance menu. I then like to have a &#8220;floating&#8221; panel placement with Mail, Bookmarks, Contacts etc selected, and &#8220;show panel placement at edge of window&#8221;. Then when you click on e.g. the Received view in the mail panel, the window will open up.<br />
- Selecting &#8220;Restore All&#8221; in the main Window menu will give you all your windows/tabs detached from the background, then you can move them around<br />
- In the &#8220;customize&#8221; menu mentioned earlier, you can select the buttons tab and drag the buttons anywhere you want - dragging &#8220;All accounts&#8221; and &#8220;Start search&#8221; into the mail panel and the mail view window can be very useful as you can then restrict a view (or a search) to just one account. Also having the &#8220;Check&#8221; button in the mail menu is useful as you can &#8220;Check All&#8221; or check just one account.<br />
- I think the main toolbar panel needs some buttons dragging into it as it misses back and forward and some other by default - you can do this using the technique above.<br />
- There are various keyboard shortcuts and mouse gestures like F11 for full screen, plus you can define your own. See Tools -> Preferences -> Advanced -> Shortcuts where you can click on edit to see all of them.<br />
- The Opera forums at http://my.opera.com are a goldmine - people are usually very responsive when you&#8217;ve got a problem (as long as you&#8217;ve searched the forum for an answer already)<br />
- On the Appearance -> Toolbars menu I have the progress bar pop up at the bottom of the page, select &#8220;images and text below&#8221; in Style and &#8220;No wrapping&#8221; in Wrapping. I don&#8217;t bother with the status standard toolbar, but do have a personal bar (you can put bookmarks on it, or whole bookmarks folders)<br />
- Skins are in the Appearance menu, I have Zephyr running. Lots more on the Opera site</p>
<ul>
<strong>Main Preferences</strong></ul>
<p>- The Tools -> Quick Preferences menu is quite useful<br />
- To get PDFs viewable in an Opera window you might need to install a plug-in DLL in the right directory - details in Opera forum (plus you need 8.51 as there was a bug with it in 8.50)<br />
- In the preferences -> general menu, selecting &#8220;Continue from last time&#8221; as a Startup option is good - it will even continue from where you were if it crashes (it doesn&#8217;t crash too too often these days). I&#8217;ve also got &#8220;Open pages in tabs&#8221; selected as the pages option. If your panel placement is &#8220;floating&#8221; in the appearance menu then I find this is really flexible as you can move your windows around.<br />
- I don&#8217;t bother with Wand (tools -> preferences) but I do have the auto-complete section filled out so that I don&#8217;t have to type in my street address every time I fill in an HTML form<br />
- The Tools -> Preferences -> Advanced settings are where the fine stuff happens. I&#8217;ve got &#8220;Remember last size&#8221; selected for Browser -> New Pages so that all new pages open in a standard size - you may need to &#8220;restore all&#8221;, change the size of the window to the way you want it, then exit/restart Opera to get it working just the way you want it. Also, &#8220;Cycle Pages&#8221; in recently-used order allows you to cycle through the open windows using CTRL-TAB. Reuse existing page is clicked, as is show scroll bars. Can&#8217;t remember why, but I have smooth scrolling turned off - think for CPU or memory reasons on my crappy PC at home.<br />
- I don&#8217;t bother with this, but Preferences -> Advanced -> search allows you to define a URL like &#8220;g andre stiphout&#8221; to search Google for your name when you hit return. I don&#8217;t bother because I have &#8220;Google Search&#8221; and &#8220;Find in Page Search&#8221; buttons dragged into each browser window from the Appearance menu, so I just type in the Google search term there and hit return.<br />
- In preferences -> advanced -> history, I&#8217;ve got the memory cache set to automatic.<br />
- Proxy servers are under network in advanced preferences</p>
<ul>
<strong>M2 Mail Client</strong></ul>
<p>- M2 is great for running multiple mail accounts on one machine - you can check them all individually or the whole lot in one go<br />
- Most of the mail settings are in tools -> mail and chat accounts<br />
- When sending from my laptop, I automatically BCC myself so that my home PC will always pick up a copy of any mail I send. I then have &#8220;Leave messages on server&#8221; selected in accounts -> edit -> incoming for the laptop, but not the home PC. Guess I could use IMAP for this&#8230;<br />
- If you want to use multiple &#8220;From:&#8221; addresses with the same POP3 account, then set up another account and uncheck the &#8220;Include this account when checking manually&#8221; box in accounts -> edit -> incoming.<br />
- I have the &#8220;Check/Send&#8221;, &#8220;Compose&#8221;, &#8220;Start Search&#8221; and &#8220;All Accounts&#8221; buttons in the mail panel in the floating panels. Then I can select which account to check from the drop-down, only look at one account by selecting an account from the &#8220;All Accounts&#8221; drop-down, and search for mail by typing in a keyword - it will automatically open a search window when you hit return. If you then click on All Messages -> Received in the panel, it will change the contents of the mail window to the received view,although you can come back to the search by selecting it under the &#8220;Searches&#8221; views.<br />
- When you hit compose you just select the From: address and it will send the mail from the account and automatically change the signature you have defined in the &#8220;outgoing&#8221; settings for that mail account.<br />
- I have unselected &#8220;Automatically wrap outgoing messages&#8221; in the outgoing settings as I found that wrapping was getting nasty, but I do have &#8220;Add contacts when sending message&#8221; selected as then you can just type in the first few letters of a contacts name and Opera will give you a list of options.<br />
- Whilst only one mail/news view window may happen to be open at the same time, Opera will remember the settings separately. So you can &#8220;view -> threaded&#8221; for a mailing-list by clicking on the view button in a mail view and &#8220;view -> flat&#8221; for a general window (which may or may not contain the same mailing-list messages.<br />
- I&#8217;ve also got &#8220;Display&#8221; set to &#8220;List and message below&#8221; in the mail window view settings.<br />
- Mailing-lists are recognised by some kind of X-mailing-list header so some of them don&#8217;t show up as a mailing-list. However, the ones that do have the right headers make use of this incredibly useful feature in the mail panel where you can just click on &#8220;Mailing-lists&#8221; and then select the list to see the latest messages. You can also remove mailing-lists from your normal &#8220;Received&#8221; view if you only want personal mail to be shown.<br />
- I only have &#8220;read&#8221;, &#8220;mailing-lists&#8221; and &#8220;filtered&#8221; showing in my received view. You can click on the &#8220;spam&#8221; button to dump something into the spam view - the filter learns quite quickly, but you need to scan your spam folder every so often for false positives and then click the &#8220;not spam&#8221; button. If any of the buttons aren&#8217;t in any windows just drag them from the appearance menu.<br />
- Because I have something over 200,000 mails on my PC at home I&#8217;ve got Period set to 1 month in the view -> period menu in the Received mail view which improves the speed of the application. This doesn&#8217;t stop mails from &#8220;Forever&#8221; showing up when I search for a keyword.<br />
- &#8220;Redirect&#8221; is equivalent to &#8220;bounce&#8221; in Pine.<br />
- I can&#8217;t remember how I set the quote mark as a &#8220;>&#8221; in the composer window, but each composer window has it&#8217;s own view menu where you can add header fields.<br />
- You can also add RSS feeds in the feeds menu - I&#8217;ve got about 30 in there! When you view a weblog or another site with an RSS feed in your browser window, a small RSS icon pops up in the URL bar. Click on this to subscribe to the feed.<br />
- When you import mail from an mbox file it gives it its own account/view.<br />
- Empty trash just by right-clicking on the trash view in the panel. I use CTRL-A to select all mail in my spam view, then hit the delete key, which dumps the spam into the trash view/folder. Then right-click to delete.<br />
- Saving attachments used to be easy with the standard windows save menu but now it&#8217;s a bit of a pain as Opera introduced its own menu. Lots of people complained on the forums though, and that often has an effect, so maybe it will be changed at some point.</p>
<p>Okay, hope that helps people out a bit. Feel free to drop me a comment if you&#8217;ve got more questions.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=126</wfw:commentRSS>
		</item>
		<item>
		<title>PHP script for server ping monitoring</title>
		<link>http://blog.a2b.cc/?p=94</link>
		<comments>http://blog.a2b.cc/?p=94#comments</comments>
		<pubDate>Tue, 25 Oct 2005 14:22:20 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>techie</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=94</guid>
		<description><![CDATA[Posting contains a PHP script I wrote to monitor a server (or many servers) periodically using ping ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using a PHP script I wrote to monitor whether some of our servers are alive or dead using ping, and send an alarm email if there is no response from the server for a certain period of time.  It wasn&#8217;t working properly, and today I finally fixed it.</p>
<p>The script can be run from the command line and allows you to define the ping target or destination (the server) you want to monitor, the name of the machine you are pinging from (useful if you&#8217;re pinging to and from a matrix of machines) and the email address you would like to send any alarm emails to. It seems to work well on a couple of Linux machines I tried it on.</p>
<p>You run the script using e.g. the following command:</p>
<div class="codesnip-container" >/usr/bin/php /home/username/php-monitor/ping-host.php -h target.example.com -l pinger.example.com -e myaddress@example.com,+31628233133@sms.orange.nl</div>
<p>&#8230;where you need to put the path to the php package in your setup instead of &#8220;/usr/bin/php&#8221;, you need to put the path to the PHP script (I named it ping-host.php but you could call it something different), -h is the &#8220;host&#8221; you are pinging, -l is the name of the &#8220;localhost&#8221;, i.e. the machine you are pinging from, and -e is the email address (or multiple email addresses) you want to send any alarm mails to.</p>
<p>I have an &#8220;email to SMS&#8221; address as one of the alarm message recipient, so I get a text (SMS) message on my GSM mobile phone if one of the servers I&#8217;m monitoring has been down for 10 minutes or 25 minutes. You could also run a whole network monitoring project with this, using it to ping routers or switches.</p>
<p>I&#8217;ll put the script into the posting below, but in order to run this, you also need a table in a database which looks like this:</p>
<div class="codesnip-container" >CREATE TABLE mon_host_ping (<br />
  mon_host_ping_id int(5) NOT NULL auto_increment,<br />
  mon_host_ping_hostname varchar(128) NOT NULL default &#8216;&#8217;,<br />
  mon_host_ping_factor bigint(16) default NULL,<br />
  mon_host_ping_lastupdt timestamp(14) NOT NULL,<br />
  PRIMARY KEY  (mon_host_ping_id),<br />
  UNIQUE KEY mon_host_ping_hostname (mon_host_ping_hostname)<br />
) TYPE=MyISAM;</div>
<p>- You should just be able to cut-and-paste that into the database</p>
<p>I just run this script on a cron job once a minute (feel free to alter the values you use) for each server to be monitored. The line in the crontab looks like this:</p>
<div class="codesnip-container" >*       *       *       *       *       /usr/bin/php /home/username/php-monitor/ping-host.php -h target.example.com -l pinger.example.com -e myaddress@example.com,+316555544445@sms.orange.nl</div>
<p>Every time you add a new server to the ping list in your crontab you&#8217;ll also need to add a row in the mon_host_ping table in the database with its mon_host_ping_factor set to zero:</p>
<div class="codesnip-container" >mysql> insert into mon_host_ping values(NULL, &#8220;target.example.com&#8221;, 0, NOW());<br />
Query OK, 1 row affected (0.00 sec)</div>
<p>Okay, so now here&#8217;s the code for the script, ping-host.php :</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">&lt;?php</span></p>
<p><span class="co2">## This script was originally published by Sam Critchley on 2005-10-25</span><br />
<span class="co2">##See http://blog.a2b.cc for more details and check out http://www.a2b.cc</span><br />
<span class="co2">##to see a great (geo)location-based search engine while you&#8217;re at it!</span></p>
<p><span class="co2">## MySQL config section</span><br />
<span class="co1">// Define users, passwords, etc</span><br />
<a href="http://www.php.net/define"><span class="kw3">DEFINE</span></a> <span class="br0">&#40;</span>DB_USER, <span class="st0">&#8220;dbusername&#8221;</span><span class="br0">&#41;</span>;<br />
<a href="http://www.php.net/define"><span class="kw3">DEFINE</span></a> <span class="br0">&#40;</span>DB_PASSWORD, <span class="st0">&#8220;dbpassword&#8221;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// Define the host which the database is running on (usually localhost)</span><br />
<a href="http://www.php.net/define"><span class="kw3">DEFINE</span></a> <span class="br0">&#40;</span>DB_HOST, <span class="st0">&#8220;localhost&#8221;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// Define the name of the database being used</span><br />
<a href="http://www.php.net/define"><span class="kw3">DEFINE</span></a> <span class="br0">&#40;</span>DB_NAME, <span class="st0">&#8220;dbdatabasename&#8221;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// Connect to the MySQL server</span><br />
<span class="re0">$db_connection</span> = @<a href="http://www.php.net/mysql_connect"><span class="kw3">mysql_connect</span></a> <span class="br0">&#40;</span>DB_HOST, DB_USER, DB_PASSWORD<span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a> <span class="br0">&#40;</span><span class="st0">&#8216;Could not connect to the MySQL server sorry: &#8216;</span> . <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// Select the right database</span><br />
<a href="http://www.php.net/mysql_select_db"><span class="kw3">mysql_select_db</span></a> <span class="br0">&#40;</span>DB_NAME<span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a> <span class="br0">&#40;</span><span class="st0">&#8216;Could not select the database: &#8216;</span> . <a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co2">## End MySQL config section</span></p>
<p><span class="co2">## Main script</span><br />
<span class="co1">// Work out the variables from the arguments on the command line</span><br />
<span class="co1">// First get the -h, -l and -e arguments from the command issued</span><br />
<span class="co1">// and put them into an array call $getoptarray</span><br />
<span class="re0">$getoptarray</span> = <a href="http://www.php.net/getopt"><span class="kw3">getopt</span></a><span class="br0">&#40;</span><span class="st0">&#8220;h:l:e:&#8221;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// Then derive the pinged hostname, the source machine, and the email address</span><br />
<span class="co1">// to send a warning mail to, from the argument-derived variables</span><br />
<span class="re0">$hostname</span> = <span class="re0">$getoptarray</span><span class="br0">&#91;</span>h<span class="br0">&#93;</span>;<br />
<span class="re0">$localhost</span> = <span class="re0">$getoptarray</span><span class="br0">&#91;</span>l<span class="br0">&#93;</span>;<br />
<span class="re0">$monitoremailaddress</span> = <span class="re0">$getoptarray</span><span class="br0">&#91;</span>e<span class="br0">&#93;</span>;</p>
<p><span class="co1">// Now run an exec command to ping the hostname and grab the output</span><br />
<span class="re0">$str</span>=<a href="http://www.php.net/exec"><span class="kw3">exec</span></a><span class="br0">&#40;</span><span class="st0">&#8220;ping -c 1 -w 1 $hostname&#8221;</span>,<span class="re0">$a</span>,<span class="re0">$a1</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// If there&#8217;s some output from the ping command then the ping has succeeded</span><br />
<span class="kw1">if</span><span class="br0">&#40;</span><a href="http://www.php.net/strlen"><span class="kw3">strlen</span></a><span class="br0">&#40;</span><span class="re0">$str</span><span class="br0">&#41;</span>&gt;<span class="nu0">1</span><span class="br0">&#41;</span><span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">// Ping response has been received, therefore can update the database record to set</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">// mon_host_ping_factor back to 0</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">// The script uses a database table called mon_host_ping and has columns</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">// mon_host_ping_hostname = hostname of the host to be pinged</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">// mon_host_ping_factor = number of times in a row host has been pinged unsuccessfully</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">// This database query sets mon_host_ping_factor to 0 if there&#8217;s a successful ping</span><br />
&nbsp; &nbsp; &nbsp;<span class="re0">$query</span> = <span class="st0">&#8220;update mon_host_ping set mon_host_ping_factor = 0 where mon_host_ping_hostname = &#8216;$hostname&#8217;&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp;<span class="re0">$query_db</span>=<a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$query</span>, <span class="re0">$db_connection</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><span class="st0">&#8220;Could not run the SQL Query&#8221;</span><span class="br0">&#41;</span>;</p>
<p><span class="co1">// If there is no output from the ping command then the ping has not succeeded</span><br />
<span class="co1">// and you should generate an alarm mail if it hasn&#8217;t succeeded for 10 minutes</span><br />
<span class="co1">// or 25 minutes (alter these values to suit)</span><br />
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">// Generate a database query adding 1 to mon_host_ping_factor if the ping is</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">// unsuccessful</span><br />
&nbsp; &nbsp; &nbsp;<span class="re0">$query2</span> = <span class="st0">&#8220;update mon_host_ping set mon_host_ping_factor = mon_host_ping_factor+1 where mon_host_ping_hostname = &#8216;$hostname&#8217;&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp;<span class="re0">$query_db2</span>=<a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$query2</span>, <span class="re0">$db_connection</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><span class="st0">&#8220;Could not run the SQL Query&#8221;</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">// Now go and grab the mon_host_ping_factor back again, and send a mail if</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">// it&#8217;s equal to 10 or 25 (minutes assuming you&#8217;re running this script on a</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">// cron job every 1 minute)</span></p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">// Generate a MySQL query to work out what mon_host_ping_factor is</span><br />
&nbsp; &nbsp; &nbsp;<span class="re0">$query3</span> = <span class="st0">&#8220;select * from mon_host_ping where mon_host_ping_hostname = &#8216;$hostname&#8217;&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp;<span class="re0">$query_db3</span>=<a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$query3</span>, <span class="re0">$db_connection</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><span class="st0">&#8220;Could not run the SQL Query&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp;<span class="co1">// and then put the result into an array</span><br />
&nbsp; &nbsp; &nbsp;<span class="re0">$row</span> = @<a href="http://www.php.net/mysql_fetch_object"><span class="kw3">mysql_fetch_object</span></a><span class="br0">&#40;</span><span class="re0">$query_db3</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp;<span class="co1">// And put the mon_host_ping_factor into a variable</span><br />
&nbsp; &nbsp; &nbsp;<span class="re0">$hostfactor</span> = <span class="re0">$row</span> -&gt; <span class="me1">mon_host_ping_factor</span>;</p>
<p>&nbsp; &nbsp; &nbsp;<span class="co1">// Now send an alert email to the address specified in the command line if</span><br />
&nbsp; &nbsp; &nbsp;<span class="co1">// the ping has been unsuccessful 10 or 25 minutes in a row</span><br />
&nbsp; &nbsp; &nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#40;</span><span class="re0">$hostfactor</span> == <span class="nu0">10</span><span class="br0">&#41;</span> or <span class="br0">&#40;</span><span class="re0">$hostfactor</span> == <span class="nu0">25</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Set the body of the message</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$emessage</span> = <span class="st0">&#8220;ALERT - $hostname unpingable from $localhost for $hostfactor min&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Set the name for the From: part of the email</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$myname</span> = <span class="st0">&#8220;My Service server monitoring&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Set the originator&#8217;s email address</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$myemail</span> = <span class="st0">&#8220;monitoring@example.com&#8221;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Get the address to which the email will be sent from the command line variable</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$site_email</span> = <span class="re0">$monitoremailaddress</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Now set the headers to be added to the email</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$headers</span> .= <span class="st0">&#8220;MIME-Version: 1.0<span class="es0">\r</span><span class="es0">\n</span>&#8220;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$headers</span> .= <span class="st0">&#8220;Content-type: text/html; charset=iso-8859-1<span class="es0">\r</span><span class="es0">\n</span>&#8220;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$headers</span> .= <span class="st0">&#8220;From: &#8220;</span>.<span class="re0">$myname</span>.<span class="st0">&#8221; &lt; &#8220;</span>.<span class="re0">$myemail</span>.<span class="st0">&#8220;&gt;<span class="es0">\r</span><span class="es0">\n</span>&#8220;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$headers</span> .= <span class="st0">&#8220;X-Mailer: My Service Mailserv&#8221;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Now use the PHP mail() function to send the email to the recipient(s)</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/mail"><span class="kw3">mail</span></a><span class="br0">&#40;</span><span class="re0">$site_email</span>, <span class="st0">&#8220;ALERT - $hostname unpingable from $localhost for $hostfactor min&#8221;</span>, <span class="re0">$emessage</span>, <span class="re0">$headers</span><span class="br0">&#41;</span>;</p>
<p>&nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp; <span class="br0">&#125;</span></p>
<p><span class="co2">## End main script</span></p>
<p><span class="kw2">?&gt;</span></div>
</div>
<p>I also learnt how to use the PHP getopt() function properly to import command-line arguments into a PHP script. If you&#8217;ve read this  far, you may have noticed that the script used the following PHP line:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="re0">$getoptarray</span> = <a href="http://www.php.net/getopt"><span class="kw3">getopt</span></a><span class="br0">&#40;</span><span class="st0">&#8220;h:l:e:&#8221;</span><span class="br0">&#41;</span>;<br />
<span class="co1">// Then derive the pinged hostname, the source machine, and the email address</span><br />
<span class="co1">// to send a warning mail to, from the argument-derived variables</span><br />
<span class="re0">$hostname</span> = <span class="re0">$getoptarray</span><span class="br0">&#91;</span>h<span class="br0">&#93;</span>;<br />
<span class="re0">$localhost</span> = <span class="re0">$getoptarray</span><span class="br0">&#91;</span>l<span class="br0">&#93;</span>;<br />
<span class="re0">$monitoremailaddress</span> = <span class="re0">$getoptarray</span><span class="br0">&#91;</span>e<span class="br0">&#93;</span>;</div>
</div>
<p>This finally worked, but I had to try various combinations to get it working:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="re0">$hostarray</span> = <a href="http://www.php.net/getopt"><span class="kw3">getopt</span></a><span class="br0">&#40;</span><span class="st0">&#8220;h:&#8221;</span><span class="br0">&#41;</span>;<br />
&nbsp;<span class="re0">$hostarray</span> = <a href="http://www.php.net/getopt"><span class="kw3">getopt</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp;<span class="re0">$hostarray</span> = <a href="http://www.php.net/getopt"><span class="kw3">getopt</span></a><span class="br0">&#40;</span><span class="st0">&#8220;h:&#8221;</span><span class="br0">&#41;</span>; <span class="re0">$localhost</span> = <a href="http://www.php.net/getopt"><span class="kw3">getopt</span></a><span class="br0">&#40;</span><span class="st0">&#8220;l:&#8221;</span><span class="br0">&#41;</span>;</div>
</div>
<p>I finally worked out that you need to put all the arguments you&#8217;re expecting in the original getopt() function as it can only be called once on a script run from the command line - in this case the arguments are all dumped into the $getoptarray array and you can then pull them out individually using something like this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="re0">$hostname</span> = <span class="re0">$getoptarray</span><span class="br0">&#91;</span>h<span class="br0">&#93;</span>;<br />
<span class="re0">$localhost</span> = <span class="re0">$getoptarray</span><span class="br0">&#91;</span>l<span class="br0">&#93;</span>;<br />
<span class="re0">$monitoremailaddress</span> = <span class="re0">$getoptarray</span><span class="br0">&#91;</span>e<span class="br0">&#93;</span>;</div>
</div>
<p>Any queries, just post a comment. Better still, have a look at <a href="http://www.a2b.cc">A2B</a>, download the free GPS software, add your blog, pass on the recommendation to a few other people, and <em>then</em> post a comment. <img src='http://blog.a2b.cc/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=94</wfw:commentRSS>
		</item>
		<item>
		<title>Jeepx: GPS Discoveries writes on Navio and A2B</title>
		<link>http://blog.a2b.cc/?p=93</link>
		<comments>http://blog.a2b.cc/?p=93#comments</comments>
		<pubDate>Fri, 21 Oct 2005 13:33:02 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>A2B</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=93</guid>
		<description><![CDATA[Great to have the support]]></description>
			<content:encoded><![CDATA[<p>Thanks to an <a href="http://forum.a2b.cc/viewtopic.php?t=57">A2B Forum posting</a>, I noticed that A. Sergio Cardoso had written a <a href="http://jeepx.blogspot.com/2005/10/geotags-a2b-navio-lbs.html">review</a> of A2B and Navio on his blog, <a href="http://jeepx.blogspot.com/">jeepx: GPS discoveries</a>. Great stuff!</p>
<p>Well, it&#8217;s up to you to read the posting and draw your own conclusions, but we will be adding the ability to post a URL and/or a POI in the very near future (especially now that this author has returned from a stint working on another project in the UK).</p>
<p>By the way, A. Sergio, feel free to go ahead and share your calibrated maps through the forum&#8217;s <a href="http://forum.a2b.cc/viewforum.php?f=7">thread on this topic</a>. </p>
<p>I also note that A. Sergio has a link to <a href="http://www.gpsdash.com/">GPSDash</a> on his site, which is another great GPS application. Some day I hope GPSDash will also build A2B functionality into their application.</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=93</wfw:commentRSS>
		</item>
		<item>
		<title>Setting up SSH tunneling in Windows XP</title>
		<link>http://blog.a2b.cc/?p=86</link>
		<comments>http://blog.a2b.cc/?p=86#comments</comments>
		<pubDate>Tue, 12 Jul 2005 16:53:04 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>techie</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=86</guid>
		<description><![CDATA[I read about how Vodafone Germany is blocking VoIP traffic on a thread at Volker Weber&#8217;s VOWE blog, having got there from Eurotelcoblog. One or two people asked for some hints on how to set up SSH tunneling for TCP traffic. It&#8217;s quite easy, here&#8217;s how to do it for SMTP access on port 25 [...]]]></description>
			<content:encoded><![CDATA[<p>I read about how Vodafone Germany is blocking VoIP traffic on a thread at Volker Weber&#8217;s <a href="http://vowe.net/archives/006041.html">VOWE</a> blog, having got there from <a href="http://eurotelcoblog.blogspot.com/">Eurotelcoblog</a>. One or two people asked for some hints on how to set up SSH tunneling for TCP traffic. It&#8217;s quite easy, here&#8217;s how to do it for SMTP access on port 25 to a particular mail server with a Windows machine and access to an SSH server.</p>
<p>What you will need for this example:</p>
<p>- Windows 98/2000/XP machine (other OSes work too)<br />
- SSH client which allows port forwarding (we use <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">Putty</a>, which is free, on our Windows machine)<br />
- SSH server which has port forwarding configured, running on a remote machine (this example is using OpenSSH sshd on SuSE Linux) - usually you can run this machine at home<br />
- SMTP server name and port number (usually 25) which you use for sending mail. If you&#8217;re trying to do VoIP, you can just substitute your VoIP port(s) here.</p>
<p>Step 1 - Set up the SSH server to allow port forwarding<br />
This is as simple as unhashing the following line in your sshd_config (normally either /etc/sshd_config or /etc/ssh/sshd_config) file which controls the configuration of the ssh service on your server:</p>
<p>From:<br />
#AllowTcpForwarding yes</p>
<p>To:<br />
AllowTcpForwarding yes</p>
<p>You then need to restart the ssh daemon - if you&#8217;re running SuSE Linux you can usually do that using the YAST configuration tool. The SSH service will now send all traffic forwarded to it off to the correct destination.</p>
<p>Step 2 - set up your SSH client to port forward:<br />
In Putty, this is very simple. Create an SSH session to your ssh server by entering the IP address and port number (usually the default port 22). Now configure SSH tunnels under Connection -> SSH -> Tunnels on the left-hand side of the Putty session configuration screen.</p>
<p>Pick a high port on the local machine which the email client can be configured to connect to - I recommend adding 3000, 4000 or 5000 onto the existing port, giving you 3025, 4025 or 5025 - we will use 3025. Now, enter the port and host in &#8220;Add new forwarded port&#8221;. For &#8220;source port&#8221;, enter the high port you have just picked on the local machine, so &#8220;3025&#8243;. For &#8220;Destination&#8221;, enter the hostname of the mail (or VoIP) server and the port used on that machine, with a colon between them - e.g. &#8220;smtp.example.com:25&#8243;. Then click on &#8220;Add&#8221;, go back to &#8220;Session&#8221; on the left-hand side of the configuration screen, name your session in the &#8220;Saved Sessions&#8221; box, and click on Save. It&#8217;s also worth reading the Putty help file for port forwarding.</p>
<p>You now have an SSH session which is capable of taking traffic sent to port 3025 on the local machine, forwarding it through the SSH session, and sending it to smtp.example.com port 25 once it reaches the the SSH server. Now you just need to set your Windows PC and email software up to be able to use it.</p>
<p>Step 3 - configure the hosts file on your Windows PC<br />
In order for your PC to know that traffic for a certain destination has to go via a local port, you have to change the hosts file to override the DNS it uses to work out the IP address (e.g. 192.168.23.5) for a particular hostname (e.g. smtp.example.com). In Windows, you do this by editing the hosts file, which is normally C:\WINDOWS\system32\drivers\etc\hosts in Windows XP, and similar in other Windows OSes). Edit this (in Notepad or Wordpad) file to add a &#8220;localhost&#8221; line entry for your chosen remote machine:</p>
<p>127.0.0.1	localhost smtp.example.com</p>
<p>Now save this file (making sure it doesn&#8217;t become &#8220;hosts.txt&#8221; instead of just plain &#8220;hosts&#8221;). Your PC now thinks that &#8220;smtp.example.com&#8221; is a local machine (known as &#8220;localhost&#8221;) - when you send traffic to it on port 3025 the SSH tunnel will pick it up and forward it to the correct destination.</p>
<p>Step 4 - configure your email program<br />
Now that you&#8217;ve configured your PC to think that smtp.example.com is local (or localhost), and Putty to forward all traffic on port 3025 to the remote destination you specified, you can set up your mail client to send traffic for smtp.example.com to port 3025 instead of port 25. Most mail clients will allow you to define the port that your SMTP server uses (I&#8217;m using the M2 client which comes with the free <a href="http://www.opera.com">Opera</a> browser) - just go in and change the SMTP server entry settings from port 25 to port 3025.</p>
<p>Now you can get everything running - start the SSH session to the SSH server using Putty, and when you send mail your email client will send it to smtp.example.com via your SSH session - great if port 25 access is restricted from where you are, but SSH is open.</p>
<p>The only thing to watch out for is that you can only have port 3025 running once on your PC - if you want to connect to multiple SMTP servers (for example) use other local ports such as 4025, 5025 etc etc.</p>
<p>Enjoy!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=86</wfw:commentRSS>
		</item>
		<item>
		<title>Google Maps API launched</title>
		<link>http://blog.a2b.cc/?p=84</link>
		<comments>http://blog.a2b.cc/?p=84#comments</comments>
		<pubDate>Thu, 30 Jun 2005 12:40:18 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
		
	<category>A2B</category>
		<guid isPermaLink="false">http://blog.a2b.cc/?p=84</guid>
		<description><![CDATA[Yesterday, Google officially released its Google Maps API - the details of how to put Google maps on a website using Javascript. This is quite an amazing development. No geocoding or routing, but I&#8217;m sure that&#8217;s due to licensing with Navteq and TeleAtlas.
Having signed up and received my key, I tried a few things out [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, Google officially released its <a href="http://www.google.com/apis/maps/">Google Maps API</a> - the details of how to put Google maps on a website using Javascript. This is quite an amazing development. No geocoding or routing, but I&#8217;m sure that&#8217;s due to licensing with Navteq and TeleAtlas.</p>
<p>Having signed up and received my key, I tried a few things out with the mapping service last night (and had to join their <a href="http://groups-beta.google.com/group/Google-Maps-API">mailing-list</a> to get a couple of things sorted out.</p>
<p><a href="http://www.a2b.cc/test/nonpublic/gmaps3.a2b">This</a> is what I&#8217;ve come up with so far - putting markers on a map of my choosing.</p>
<p>The main disadvantage so far is that there&#8217;s no way to specify a map which specifies longitudes (West and East) for its left- and right-hand edges, and latitudes (North and South) for it&#8217;s top and bottom. Instead, you have to do this by centering the map on a latitude and longitude, then choose a zoom level appropriate for the number of markers you have on the map. Oh well, guess I can do <em>something</em> with it&#8230; <img src='http://blog.a2b.cc/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.a2b.cc/?feed=rss2&amp;p=84</wfw:commentRSS>
		</item>
	</channel>
</rss>
