26 Mar 2013

Sky Broadband and Third Party Routers

Had any problem connecting a third party modem/router to Sky? Well, have a read of this... I'm still a darker shade of purple as I type... Or if you've had a gutsful of other people bellyaching, skip to the solution section, I won't hold it against you. :)

Background

On Wednesday evening, my Sky Broadband modem/router broke. Dead. I had a backlog of school work to get through - marking work posted to our Moodle site, etc, so it was imperative that I got back online as soon as possible. I went down to my local 24-hour Tesco superstore and bought a shiny new TP-LINK TD-8961ND Wireless Modem Router for about £35. Okay, so a little pricey, but at short notice, not too bad.

Anyway, got it home, inserted the setup CD and tried to connect. All systems go except for the bit where it asked for connection details (username and password). I tried everything. Nada. Okay, just phone Sky for the details and I could be on my way.

I spoke to a lovely operator, who told me that they didn't have any training with regard to third party modem routers. I assured her that I didn't need support with the modem, just my Sky username and password. No... no idea of what I was talking about - and I was assured that nobody in the office had any idea either. I was told that a new Sky modem router could be sent out in 3 working days. That made it Saturday or Monday, depending on your definition of working day. Oh, one more thing, I would be charged £35. No, says I, I don't want to fork out another £35 as I have a perfectly good model fresh out of the box. She said that I could get a free modem router if I swapped over the landline (from BT) to Sky. There was no real difference in price, so I thought what the hell. I enquired whether they had a preferential delivery service - but no, no they didn't. What did I expect?

Saturday came and went - nothing. OK, Monday then. I thought I'd give Sky a ring to confirm that the item would be delivered today - after all every company has order tracking now right?

I was answered by a polite young lady, whose non-native accent was so strong that I had great difficulty in understanding her. Nevertheless I understood her well enough to ascertain that my request hadn't been logged until Saturday. That's strange I countered as confirmation of my change of landline rental had arrived this very morning. How come? After a lot of umming and ahhing, I was told that her supervisor would get back to me within the hour. Okay now we're getting somewhere.

I held off going out as the super was going to phone my landline. One hour became two, became three... Okay, this was getting ridiculous. Then a phone call... from BT asking me to confirm that I wanted to switch my landline from them. Then came the hard sell. I fobbed them off, as I didn't want to be on the phone while Sky were trying to contact me. Finally, I telephoned Sky again.

This time, I was greeted by a delightful young man, who was extremely helpful and very apologetic. He offered to contact the Royal Mail to track down my order. After 5 minutes of listening to some banal music, he came back with some bad news. The Royal Mail, he claimed, couldn't track the location of my item, but could confirm that it had been dispatched. Fat lot of help. With regard to the third party modem router, he offered to put me on hold again while he discussed with his supervisor. Another five minutes later - this time without the soul-destroying musical interlude - he came back with more bad news. He'd asked 3 different supervisors and none of them could help. I asked him why, out of all the ISPs out there, how is it that they could not supply me with my connection details. I was given, what I assume to be the party line. "Security and my protection". Nothing to do with control and making even more money then? Perhaps that's a bit harsh, but how do other ISPs allow third party modem routers? Are they fundamentally unsafe and deserving of a blast of hellfire up their derrières? Anyway...

I then hit on the idea of cancelling the whole comms package with Sky and signing up with BT. So I gave them a ring - thinking I could use my new hardware to connect today. How naïve. I was told that I needed a migration code from Sky and that it would take five working days to connect me from receipt of said migration code. Darn, square one. I fell back on my son's wireless hotspot app on his smartphone. Two hours of searching on various forums led me in circles and I was about to give up when I hit upon a thread which answered all my needs. I have implemented the advice and now have access to Sky Broadband via my TP-LINK modem router. However, I may be in breach of my Sky contract. If I get blocked, I'll simply cancel my subscriptions and go with somebody I can trust. I may do so anyway, I'm that fed up with them. What follows is the route to my success. Please be aware that I take no responsibility for anybody who repeats these steps. Read all the caveats in the various links and come to your own decision. This is simply "my story".

Solution

I came across this thread: http://www.skyuser.co.uk/forum/extracting-sky-router-passwords/47888-username-pw-dead-sky-router.html#post364848 which then led me to this one: http://www.skyuser.co.uk/forum/extracting-sky-router-passwords/19953-getting-your-v1-v2-router-passwords-safe-way.html#post126268. That one finally led here: https://www.cm9.net/skypass/

I just needed to know the model of my dead Sky modem router (DG834GT) - there's a description of all the models, so getting it right is a no-brainer. I just entered the MAC address on the bottom of the Sky modem router to a form and hey presto, my username and password were writ large on the screen:

I then stored this data to a text file and sparked up the old TP-LINK CD again, connecting the modem router cable to the laptop. The settings required (or worked) for my setup were:

  • Country: UK
  • ISP: Sky Broadband
  • WAN Connection Type: PPPoA
  • VPI [0-255]: 0
  • VCI [32-65535]: 38

Your Security Settings are up to you, but ensure that you store the Security Key as you may need to use it to access the wireless connection.

9 Mar 2013

Using Subversion in Dreamweaver

When I started out, creating a few hobby sites, I came across subversioning (or something like it) and read that it was a great tool for teams working on the same files. So, not for me then, a lone coder, with limited skills. As time went on, and I started creating more complicated sites, using new technologies (well, new to me anyway), I found my workflow becoming chaotic, with loads of open files on CSS, php, js, XML etc, etc. I needed structure - especially when it came to overwriting files that bust my new shiny site, which I then had to fix by hitting the undo button 20 times, or in a worse case scenario, re-write as I'd already closed the offending file. So, Subversion to the rescue. Er, well not quite that simple. I occasionally use Dreamweaver (CS5) to develop some sites, so I was looking at it to perform as a client, only to find that it doesn't have full client capabilities, but on further reading, this isn't such a handicap as it simplifies matters considerably. In order to get Subversion up and running on my system, I first had to get a server version (msi) from here: http://www.visualsvn.com/server/download/. Then I installed it - which took a long time! - and ran it. It gave a typical installation window, which requires some parameters for setup. The main one being location. I didn't fancy placing the repositories in my root folder, so I chose a folder in my XAMPP installation. The port options available to me were 443 and 8443. Once setup, VisualSVNServer then provides you with an https url for use with your client (Dreamweaver in my case) and browser view, in the format:
https://computername:port/svn/.

You won't be able to use this until you set up an user account, so, to do that, right-click on the 'User' folder in the left panel and 'Create User'. You should then see a dialog box asking you to provide details. This will be used for client access later on in Dreamweaver.

The next step is to create a new repository for your site, simply by right-clicking on 'Repositories' and choosing 'Create New Repository...'. You'll see a dialog box asking for the repository name - so give it a name - and you have the option of setting up additional structure such as branches etc. You may not need this, so feel free to not tick the check box at this point. You can always go back and add structure later on.
Right, that should do it for the server bit. Now on to adding Subversion (SVN) server details to our site in Dreamweaver. So, get into your site setup and enter the details similar to below (the scratched out entry is just the computername from the Subversion server url - without the 'https://' bit). Also ensure that you enter the correct port.

To avoid confusion 'diafol' in the 'Repository Path' is the name of the Repository I set up earlier - nothing to do with the username. Okay, once you've filled out the details, try testing it, and once saved, away you go!
The first thing you'll notice is the little '+' icons next to all your files and directories in the 'FILES' panel. In addition, you'll now have a 'Repository View' in the Servers View dropdown:

So how to get it to work?

Simply use the Check In and Check Out options from the shortcut menu when you right-click on a file or folder in 'Local view'. When you want to save a version to the repository, use Check In. You should then get a dialog asking you for the action required:

Once you've made your choice, press the 'Commit' button. The little '+' icon next to the file or folder should then disappear. If you now make changes to a file and save it and then 'Check In', you can check whether you have various revisions, either from 'Local view' or 'Repository view'. If you go to 'Repository view' and right-click on the file in question (common.php in this case), you'll get a shortcut menu.

Select 'Show revisions...' and you should see a list of revisions for that file:

You can then view a revision, or usefully, make a previous version the current one. This can then roll back your local version to the selected one on 'Check Out'.
I hope you found this post useful and that using SVN / Subversion is not as scary as it might first appear. Obviously, I've only scratched the surface and be aware that other alternatives to SVN exist. However, for day-to-day stuff for the average DIY hobbyist, this pretty much covers most of my needs.

8 Mar 2013

GETTEXT Issues Fix with php-gettext

Having written a few posts on the merits of GETTEXT and .po files, I ran into an issue revolving around difficulties updating the .po files. It only seemed to work when I changed the location of the localization directory. I assumed that this was due to the files remaining in memory or being cached. This, it seems is a 'well known issue', although I'd never heard of it and trying to find information about it was very difficult. I came across this site: http://blog.ghost3k.net/articles/php/11/gettext-caching-in-php, which describes the phenomenon and offers a workaround. Although the workaround looks quite nice, I thought that this was a fudge and wanted an alternative.
I then came across php-gettext. This can be downloaded from https://launchpad.net/php-gettext/. This has the added bonus of providing a locale even if it isn't installed on your system. Following a bit of testing and jiggery-pokery, I finally got it to work, as follows:

  1. Unpack the archive and copy the contents somewhere on your system.
  2. Create a new directory to store the essential files - I placed them in my config folder, shown highlighted.
  3. Next include the phpgettext.php file, e.g.
    include('config/phpgettext.php');
  4. The next step is to change your
    echo _("...")
    gettext statements to
    print T_("...")
    It may be easier to do this with a find and replace in your text editor or IDE. For example:
    <?php print T_("Place text here");?>
  5. If using PoEdit, you can add the 'T_' keyword to the catalogue:
That worked like a charm for me, so pretty much 'out-of-the-box'. Now no cache problems and it seems to work equally well on Windows and Linux. :)