Archive for Computers & WWW

Verify Email

I had cause today to verify if a number of e-mail addresses really existed and stumbled across this easy to use web based tool, verify email. It’s handy because it also provides visual feedback of the interaction with the mail server on the domain which saves you having to fire up a telnet session.

Comments (4)    

Custom linux service at boot

So you’ve created a service in Linux, written a start/stop script for it, stored it in /etc/init.d/ and now you want it to actually run on boot/restart. This little line of code at a root terminal will do the trick for you.

update-rc.d <script> defaults 98 02

The <script> should be replaced with the file name of your start/stop script in /etc/init.d/ the 98 ensures it’s (likely) to be the last script to start and the 02 ensures it’s (likely) to be the first to stop.

Comments off    

Stalling File Transfer Over VPN

The other day I had cause to allow someone to access their corporate VPN over my home internet connection. After I had configured the appropriate pass-through settings for the IP address that my DHCP server had allocated their laptop they were able to connect easily. One issue remained however; whenever they checked a file out of sharepoint that was over 250Kb or so, the file transfer to their machine would stall and consequently crash the browser.

Google threw up all sorts of possibilities but the more things we tried (and that failed) the more I couldn’t escape from the idea that it must be some network related issue. I got to thinking about the nature of VPN and how there is an initial connection and then a large stream of UDP packets over the tunnel for the data transfer. That’s when a light bulb switched on – I’d seen something like that before in my Draytek router settings.

Draytek have a nice selection of anti denial of service features which I have activated to protect my network. Some of these concern certain types of flood defense; where a count of packets is maintained and if it exceeds a certain threshold then the connection will be dropped for a period of time. This would result in the appearance of a stall for any file transfer caught up in the melé. Bingo!

The culprit setting is shown in the screen shot below, “Enable UDP flood defense”. Originally this was set to 150, I had to set it to 1000 in order to eliminate that VPN issue.

Draytek DoS UDP Settings Screenshot

It’s worth discussing why the number has to be so high for my fix and why it may not need to be so high for you. Most home connections over VPN end up being below 5Mbit or so with the corporate end point on the other hand being capable of 100Mbit. This results in the overall speed obviously being tied to your 5Mbit speed. In my case I use the FTTC technology and thus have speeds up to 80Mbit. This means I can transfer many more packets per second than most people on home connections so it is likely that you won’t have to go so high as 1000 to get the desired result in the Draytek settings.

I hope this helps someone out, feel free to get in touch with me if you have any questions.

Comments (4)    

Anti-Spam Effectiveness

What website are you looking at? Sounds a simple enough question right? Well for a human maybe but perhaps not for a CAPTCHA reading online bot. A problem that’s plagued bloggers and forum administrators for years is how to stay ahead of the comment/post spam that invariably results from putting one of these sites online.

The solution until about a year ago has been to go for a centralised solution like Akismet or make your CAPTCHA ever increasingly harder to read and thus harder to crack. Unfortunately the latter has simply increased the number of frustrated users resorting to e-mail to ask for access or giving up altogether. Akismet has stayed ahead of the curve and for one-off comments on blogs and other types of media has proved invaluable. For forums however there isn’t really a reliable connection between most forum systems and Akismet and administrators have been left wondering what to replace their ageing, difficult to read and fundamentally ineffective CAPTCHAs with.

Welcome the Q&A. While this concept has been around for a while, Q&A really comes into it’s own when you factor in randomisation. If a particular style of CAPTCHA is in use by many sites then it’s well worth a spammer trying to crack it as they reap large rewards. Custom solutions on the other hand have the advantage that unless you run a huge site like BBC News, they’re not going to be worth cracking as there are easier rewards to be reaped elsewhere. While you could use a custom CAPTCHA this requires some effort and you’ll probably end up re-using someone else’s code which defeats the uniqueness objective. This is when we resort to the simple question, unique to every website. Where am I? Who is my admin?

Having implemented such unique questions to all of my forums recently I can report a resounding success. No automated registrations leaving just the handful of spamming manual ones which are easy to weed out of an early morning. The big bonus here is legit users find it a doddle to register as they either know by heart or can easily look up the answer. I also now have the slightly tangential advantage that if I were to start getting automated registrations again then my sites may well have become as popular as BBC News which would certainly bring a smile to the face.

Comments off    

Push e-mail on an iPhone or iPad

When you search google for a similar phrase to the title of this post you usually get a fairly stock response; use exchange, mobile me or gmail and you can have push e-mail by simply activating it in the mail settings. The thing is, most people who search for the above know this already. What they really want to know is how they can push e-mail with a conventional e-mail account that they may have from a hosting provider and access through thunderbird or outlook.

With BlackBerry, push e-mail is really simple. Just provide the setup screen with your IMAP enabled e-mail address and password and BlackBerry will start pushing e-mail to your phone. With iPhone and iPad it can also be that simple without changing your mail provider or e-mail address but to get there we need a step in between. I call this the fake exchange server.

A little known sourceforge project called z-push holds all the answers. Essentially by installing this PHP code on a web server and setting up a config file or two we can fool an iPhone or iPad into thinking it is talking to a Microsoft exchange server and get genuine push e-mail from a standard IMAP e-mail account!

To get started you’ll need the following:

  • A web server
  • Copy of Z-Push code
  • The details of your IMAP e-mail server

Don’t look with concern at the first requirement. You can probably make use of a shared hosting account for this, or if you were prepared to go out and spend on mobile me then you will probably be able to spend less and get your own VPS, which, if you intend to push a lot of mail, might be a better bet in the long run anyway.

Configure your web server to support SSL and install PHP. I won’t go into detail on how to do this as there are plenty of online tutorials for this already that you can google. The SSL bit is important as this will ensure that e-mail traffic from your iPhone or iPad is encrypted which is essential if you have a habit of using open WiFi connections while on the move. If you’re doing things on the cheap and using a home server then make sure you have a static IP at home. You can get a free SSL certificate from the fine folks at StartSSL.

Once your server is up, follow the instructions for installing z-push from their website. In practice I found that the stable version was far from it and didn’t really work so opted for the 2.0 alpha version. Try your luck and see what you get. There is a forum on the z-push site from where you should be able to obtain help if you need it.

With z-push installed and configured as per your IMAP e-mail server settings, you’re ready to try your luck from your Apple device. Head on over to e-mail accounts and delete the current entry you have. Once you have done this, select to configure a new account and choose Microsoft Exchange. Enter your e-mail address, username and password. Leave the domain blank and SSL on. Often your username and e-mail address are one and the same although this can vary. It’s unlikely that just these details will connect as you’re pushing mail from your dummy server, so you’ll be prompted after a few seconds for a server URL. Enter the domain name on which you have installed z-push.

Assuming all of this is accepted by your Apple device, you now just need to go to the fetch new data settings, enable push and and change fetch to manually. Open up mail and if all is working you should see your e-mail in folders. If so your final test will be to return to the home screen, send an e-mail to yourself from your PC and watch the iPhone/iPad. You should see the e-mail arrive within seconds. If so, you’re pushing mail!

At the close of this article I’d like to mention that my ability to investigate this scenario and write up the solution is due in no small part to the generosity of Stinky Ink in them putting up an iPad2 as a prize in their WordCamp UK competition, many thanks once again!

Comments off    

Foursquare Auto-Checkin

Having been a recently new joiner to the foursquare phenomenon I’ve quickly decided that I like it and that it’s leaps and bounds ahead of Facebook places. That being said, it’s not without issue. The main one being that there are places I regularly frequent that I want to check into, but don’t wish to publish on twitter. “You can do that!” I hear you cry, well yes, you can, but you still have to get your phone out of your pocket.

To me, getting one’s phone out of one’s pocket should be to actually say something, such as “I’m at somewhere new” or “I’m at somewhere I normally visit but I’m here for longer this time, come and join me”. If I’m just heading to the office or going home, I want to log that onto the statistics but not shout about it. While there is of course an option on the mobile app to do this, I have to specifically choose that option. In reality, what I really want to do is only to touch my phone if I have something to say, otherwise let foursquare do the work for me.

Enter the API! I have long been a user of google latitude. This little known service allows me, via a private API key, to retrieve the latitude and longitude coordinates of my phone wherever it is. I used this feature to track my road trip progress and it worked very well. To this end, knowing that foursquare is primarily powered by coordinates and I always have access to mine, I decided to stick my coders hat on and program my way to lazy foursuare use.

Registering for a foursquare API key is easy and it arrives straight away. Getting an OAuth token using the key was also just as easy and within a minute or so I was able to call out instructions to foursquare from my server, pretending to be me. It didn’t take me long to close the loop so that to all intents and purposes my server is me as it knows where I am.

Although it’s a little rough around the edges, I now have an application running that has a pre-set list of locations that it is allowed to check me into and when my coordinates say that I am there, it calls out to foursquare and does so.

While this is far from ready for release, I do hope to do so in not too distant future, perhaps in time for WordCamp. In the meantime I’m going to sit back and enjoy ousting my colleagues as mayor of the office, just by pulling into the car park. After all, isn’t that what this whole foursquare thing is all about?

Comments off    

Home VPN

I’ve written an article over on RouterTech about how to setup your own home VPN server. It’s something I’ve mentioned to a few people lately that I use so I figured it was time to share exactly how it’s done. Questions and comments are of course always welcome over on the RouterTech forums.

Comments off    

Spam Insight

I read a brief but interesting article on the Akismet blog today offering an insight into the current state of web based spam.

While Akismet isn’t a blocking service I personally feel that the large IP ranges identified by the article as solely in use by spammers could do with being blocked.

Comments off    

Comments on DRM

The original published date on this article, “The Day the Music Died“, is a little old but I think many of the points are still relevant to a lot of the online music services out there today. Certainly food for thought if you own an iPod or other similar device that allows you to pay for and download music that is restricted with DRM.

Comments off    

WordPress Geek

I found this amusing list of things that might make you a WordPress geek. I found myself falling into a number of the categories listed so I think it’s a strong possibility that I am in fact a WordPress geek. How do you fare against this list?

Comments off    

Next entries » | « Previous entries