Jamie Balfour

Welcome to my personal website.

Find out more about me, my personal projects, reviews, courses and much more here.

Jamie Balfour'sPersonal blog

For a fairly long time (since I moved into my halls of residence in 2013) I've been obsessed with something more than computers. Phones.

I'm not talking about smartphones, I'm talking about IP phones. VoIP or voice over IP is something I've been interested in since about 2003 when I got to use Skype for the first time. I found it incredible that we could do these things and Skype just kept getting better and better. But Skype had and still has one problem - you need a PC or some other device running the software to use it. 

As I mentioned, in 2013 I got my own IP phone in my halls of residence. I had longed to be able to test one like this so it was really awesome to get to test it for the first time. I had a Cisco one if I remember. About early 2014 I spoke with my father about getting an IP phone for the house and moving away from the standard PSTN (Public Switched Telephone Network) and with both of us being in some part of the computing industry (we both work with networking regularly), it seemed only right that we now trial this technology at home. In both of my previous offices, I got the wonderful experience of using IP phones, in particular, my last job, where we used Grandstream phones which had all the bells and whistles. I looked the phone we had at work up and to my surprise, it was only £70 odd to buy one on Amazon.  

Last Friday we officially began moving to IP phones across the house (and it's all been down to me to do it, but hey, I guess I've managed, even though it's been completely a new concept). SIP, or session initiated protocol, is the backbone of our new network. Our network is powered by a Raspberry Pi which handles all outgoing calls currently and will soon deal with incoming calls. Our original DECT analogue phones will be slowly moving to SIP, with one set of them moving this week and one will remain on the analogue line until we transfer entirely to SIP. My bedroom will use my new Grandstream GXP2170 (which was only £100 so only £30 more than I was going to pay and I got a much better phone). I'll also be finally getting my own private number in the house. 

As it happens, BT wants to switch the whole country from the basic PSTN to an IP based network to make it more competitive and it's a good move too. There's more about this change that BT wants to bring to us here.

I've finished setting up my SIP network. We've got a trunk for both inbound and outbound numbers. Asterisk on my Raspberry Pi deals with all calls and forwards them to all of three extensions (though we have more so we will need to fix that) in a ring group. If the call is a business call, i.e. one for Jambour Development, only two phones ring. If it's for the house, all phones ring. We also have voicemail and out of hours setup. 
Posted in Tech talk
sip
session
initiated
protocol
new
technology
gadget
fun

It's often been laughed at by my friends, but now it was too much (or too little). Our broadband connection was abysmal - often only achieving a paltry 2Mbps (0.25MBps). This meant that simple things like SSH couldn't even work properly and would often timeout. 

I will point out, where I live was one of the pilot locations for broadband when it first came to the UK, so we had faster broadband than quite a few people at the time. On October 26th we decided to complain about how slow our internet connection has become. During a complaint about the speed, we were told that an engineer would be out to have a look. The engineer did arrive and mentioned about the speed that we were able to get superfast broadband (up to 56Mbps or 7MBps) now according to the system. We were, of course, delighted, although a remained somewhat sceptical about this, but we decided to move to it straight away.

Now the fun starts. We were originally promised that it would be Tuesday the 31st of October and there would be absolutely no disruptions to our service until then. We were sent a BT Home Hub 5. Then within a few days, a new BT Smart Hub (aka the Hub 6). We were told to disconnect the old router and connect our new BT Smart Hub. We immediately lost our internet connection. On the 31st of October, after getting all excited for our new superfast connection, I was let down. 

On the 2nd of November, after having had no internet now for a week, meaning no maintenance on my web server or anything and only one backup downloaded in that time (thanks to my friend Calum, who allowed me to download a backup at his place using his superfast connection) I was beginning to get weary. We were annoyed that we had no superfast on this day but when we phoned BT to find out why, there were a bunch of excuses, but in the end, we figured out the main problem - the line wasn't supported. Wait a minute, didn't the say it was?

What BT said originally was not true, our house was not suitable for fibre; because we did not have a connection to the cabinet but a connection direct to the exchange, bypassing the need for the fibre-enabled cabinet. 

So we were then promised the following Tuesday (7th November) for our superfast connection. I again remained extremely unsupportive that this would be all done and dusted by then. My dad, on the other hand, kept firmly believing that this would happen.

As you guessed it, we didn't have it on Tuesday 7th of November, but we were told it would be there on Thursday the 9th (the day I was originally meant to be moving it my own house but that's for another story). We were then told on Friday the 10th that it wasn't going to happen then and would definitely be in place by the next Tuesday (14th).

All in all, I'm just so angry with BT for messing us around. I once believed they were a good company but this has changed my opinions entirely.

Another new contract and another new technology. 

This month has been pretty good for me obtaining contracts; just finishing one at the start of the month, getting a new one at the start of the month and a week ago and a potential fourth one this following week. I aim to provide my clients with the best possible service I can, and if I say so myself, I think they are pretty happy with what I offer them at present.

For my latest contract, I've been working with Stripe, which in case you haven't heard, is a fantastic way to build in a payment method into a website. I have used PayPal's API in the past and found it to be very easy to handle, however, some websites demand more than just PayPal due to users not having access to PayPal or whatever.

With the latest contract, I am working on, reviewing the requirements specification document we formed, it's completely necessary to have a seamless, transparent payment system that allows users to quickly input their details including payment details. For this, I turned back to Stripe, which I have used briefly in an experimental website I was developing a few years back. Stripe is secure and easy to use. It also looks very professional. 

Let's talk API stuff now. Stripe provides an exemplary API, however, I decided to use the PHP wrapper found on GitHub to make this lightweight. I then made my own wrapper that transforms it into a reusable script across all of the sites I host.

The great thing about the API is there is no redirect or required way in which you process data, and you choose what you want to do with the finalised output of the form. In fact, you don't even need to take payment (that's a bit silly but it's true). You need to write a simple script that will process it after. 

The main benefit of this is that you can do all sorts of things prior or after the form submission such as sending an email of receipt or a notification of a purchase on the website. You can also add this to a database that stores what a user has purchased. 

But the main thing about Stripe is its ease of deployment. It only took me about 2 hours to get the whole site up and running with a test version of Stripe.

Posted in Web Development
stripe
php
ecommerce
website

In the last few months since I setup my own server I've been experiencing something I didn't even know might have happened before now.

I'm talking about brute force attacks on each of the websites I host. None of them are at all clever and I've been mitigating these problems recently anyway. 

But before I had root access to my server I had no idea that these attacks happened so often. The last few days I have been blocking several IP addresses from SSH and website visits on the sites I host, but I'm starting to notice a trend.

In fact, this trend relates to a post I made when I first moved to WordPress. I haven't used WordPress for years and I'm happy to say that, because I wasn't a huge fan of WordPress. I ended my WordPress part of my website at the end of 2013 and I haven't looked back. However, my websites are still getting constant requests to access one certain file that doesn't exist. I'm talking about these errors in my Apache error logs:

  • /var/log/apache2/access.log.1:IP_ADDRESS - - [07/Nov/2017:12:38:28 +0000] "GET /wp-login.php HTTP/1.1" 404 28038 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1"
  • /var/log/apache2/error.log.1:[Tue Nov 07 05:37:02.133215 2017] [:error] [pid 30560] [client IP_ADDRESS] script 'wp-login.php' not found or unable to stat

There are hundreds of them! As a result, I've decided since none of my customers or myself use or will use WordPress, I'm going to block all wp-login requests.

If there's one thing you should take from this post, check your logs for the same issue!

Posted in Web Development
apache
log
wordpress
wp-login
scam
hack
brute
force

Now that ZPE 2.0 is really progressing, I thought I'd let you know about how it is doing in this post. Note by the way, that ZPE 2.0 is my C++ implementation of ZPE.

To be honest, I haven't worked as hard as I could have on ZPE 2.0 as other things still take precedence such as websites I have been working on. However, ZPE 2.0 got a bit of work last night that adds several features:

  1. If statements (no conditions yet, but if, else and end if)
  2. Tree generator view (one of the first modes added to ZPE 1.2 because it makes it easy to debug the code)
  3. Memory management tools

What will need to come next is a bit of interpreter stuff. To be honest this is where things get more complicated and I will likely need to take a bit longer than before to build it.

It's been a while since I last worked on BalfBar but the latest improvement is a huge one! The latest update is version 1.2.

The newest BalfBar release brings a bunch of changes. Most important changes are removals which now includes the floating logo (BalfBar shouldn't manage this) and the Dark Mode (later named Alternate Mode). 

Let's start with why the floating logo / logo base idea was removed. In fact, let's start with why it came to BalfBar in the first place. Many of you will remember that I used the floating logo on my own website. This was removed in about 2015 when I changed to simply have my name. No body who used BalfBar that I know of was using this feature and more importantly, BalfBar shouldn't need to deal with minor things like this. It's removal was obvious and it makes the SCSS file much easier to understand.

Next, Dark Mode. One of the oldest features of the menu was Dark Mode, originally inspired by Mac OS X when it offered us a dark menu bar etc. I became a fan and decided to upgrade my own menu (powered by jQuery Smart Menus) to have this feature. When I developed BalfBar to replace it on my website I had to include the feature. Now I realise that even I don't use this feature. The main reason for it's removal is that firstly it complicates the SCSS file, secondly it will increase the CSS output file considerably and thirdly it can easily be added if needed by just compiling two SCSS files with the different themes anyway.

The SCSS file is now completely cleaned up and ready to use again. I'm also working on adding some new menu types to it including a large menu like I used to have. This will be sometime before it is ready though since my other projects are now taking precedence again.

I have now updated the JS file to work much more fluidly. However, no longer does BalfBar add a fixed_menu class to the HTML but only to the menu. This came from the idea that it's possible that two menus maybe on the same document at the same time, causing both to go to 'fixed mode'. It also allow it to remain more clean and succinct.

One more thing about the new change is that there is now both a desktop and mobile fixed height option. This also means the removal of the permanent mobile created in the CSS. To make a BalfBar instance always mobile, use -1 as normal.

Posted in BalfBar
balfbar
1.2
wnp
menu
bar

2017 has been quite a good year for gaming but no one more so than Nintendo, at least for me.

Nintendo's two biggest releases this year have both been incredible. I'm talking about Breath of the Wild and Mario Odyssey and then let's not forget the launch of the Switch itself. 

I have spoken to loyal PS4 and Xbox One players and within both groups I have found quite a few of them were really wanting to own a Nintendo console for the first time for Breath of the Wild. To me, this marks a change because it was down to Nintendo marketing properly again. The Switch brings a fresh new Nintendo that feels more like the original Nintendo that disappeared in 2006 with the release of the Wii and one that isn't focused only on family games.

Yes, Nintendo have the year. There's no doubt.

After a ton of hard work and lots of relearning, ZPE 2.0.0 is now finally getting there! I'm proud to say that I have been able to rewrite the ZPE Parser and the YASS byte code system now also works with it. 

Pointers have been a difficult thing for me to master at first since I'm used to really high-level scripting languages, but by the end of next week, I aim to have all sorts of features added.

ZPE may now be used to power some of my websites if I can make it efficient enough. More than 30 hours have gone in since two days ago.

Now I need to decide if I want to pull the original ZPE and replace it. 

The Zenith Parsing Engine 2.0 and a lot of the interpreting and compiling features are coming soon. 

ZPE 2.0 differs hugely from ZPE 1.x because it is being rewritten in C++. As you can imagine this is a huge job for me but I've already begun rewriting the amazing parser and will soon begin work on a compiler and later interpreter. 

It's easy work for me and I love it so there's nothing to worry about. I will also likely open source the project too :). We can work together to develop the best programming language ever! Let's make it powerful, fast and efficient with memory (I'll need to write some GC tool at some point for it, if you've got experience in this, please please get in touch and we can work on bringing it to ZPE).

ZPE 1.x will continue to evolve alongside ZPE 2.x and will continue to recieve updates until I officially declare that ZPE 2.x is powerful enough to do what ZPE 1.x can. 

Next topic, Dash. Dash is now on hold for the foreseeable future. No reason other than a lack of motivation for it for now. And again, the lack of motivation is not because of anything but since it's in a really good position I want to leave it for a while before I work on it again. 

I'm working on website hosting and websites at the present time, so both of these projects are taking a backseat for the current time.

Also, I will rewrite the SCSS for BalfBar in the next few weeks because it was getting a bit messy.

Also, my Halloween theme on my website is here for 2017! 

zpe
2.0
2.x
java
c++
update
dash
halloween

First off, I have been developing websites since early 2010, and then I officially became a web developer in late 2012. When I say that I became a web developer, it's because that was when I saw the change from being a standard desktop software developer (look at my previous projects such as Painter Pro and Wonderword) to a web developer and got my first contract in January 2013. Since then I've come a long way.

When I first learned web development in 2010, I did everything with tables - because I didn't know much about CSS and found it a scary concept. As I learned Java and PHP in my own spare time I eventually picked up CSS as well. This was when I started to actually think maybe web development was the right place for me. People started to notice my website and my works such as BalfBar and BalfBlog and so on. Now, years later my website development has become a bigger part of my life - I take on jobs again.

I left my job at the start of October with the intention of doing freelance work for a while, at least until I get into teacher training because I know it's where my skills lie (and because I couldn't cope with the travel to my previous job). 

However, a few years ago I spoke to someone who had been developing websites (whilst transferring some sites to me) for some time and took some important advice. We discussed hosting sites ourselves and he told me that clients who host with you will be easier to manage than those who host with someone else, and they can get a much better tailored service. He claimed that he had been developing websites for about 7 years and manages them all himself. 

This bit of advice stuck with me for about 5 years but I didn't really act on it. Now after all those years of using different accounts for each website I built, I'm now managing all of my clients' websites. This makes both of our lives easier.

Be a good developer and host

I want to be a good web developer and host to my clients and I do this by offering them everything for so little compared with competition. My hosting and services are considerably cheaper than the competition but I currently only offer them as a single package - you can get a website created by me and I'll host it, the two are not mutually exclusive so you can no longer get a site by me and not have it hosted by me.

I offer a range of services, and maintain sites to keep them up to date with the times. I recently refurbished two of my oldest developed sites at no cost to the owner. You see, I actually enjoy this kind of thing, so doing this is a favour to me too.

To be a good host, I have a range of new things. For instance, I moved everyone on my server from PHP 5.5 to 5.6 and now to PHP 7.0 and have enabled the OP cache and so on. I have developed a bunch of reusable tools for users and I'm prepared to install other tools that users need. I've spent a lot of my personal time learning about web server maintenance and I've become really knowledgeable about it so that my clients can experience the best.

Future updates

My brother and I have been discussing a business venture that would have a significant performance improvement for all of the hosted websites at no extra cost. To be able to achieve this, however, we will need to get enough websites to host so that we don't end up paying for something that we make a loss on.

Posted in Web Development
web
development
hosting
Powered by DASH 2.0