A BOM is an acronym for byte-order mark and is essentially used to tell the type of encoding of a data stream or file without having to explicitly specify it (for instance, through the content-type header in HTTP response).

I’d been having a particular issue with an API I built for a web application I’m managing and I just couldn’t figure out what was wrong until I got to using the API in an application that had HEX output.

So I put the application in debug mode and watched the communication stream. The API was supposed to return an integer value but instead, I noticed a EF BB BF hex sequence being prepended in the output. All attempts to remove this were futile.

Since I used the Symfony framework for the application, I suspected that it might be a bug and googled for a solution. The best answer I could get was to upgrade the framework, which I did but the problem persisted.

My big break came when I attempted to make another API call to a separate method that resulted in the correct output. While tracing the source of the problem, I traced it back to a php file that was incorrectly saved in the UTF-8 character encoding format; which was included when making the buggy API call. Opening and saving this file in ANSI format solved the problem.

So next time you run into a problem like this, make sure to check the encoding of your source files. Better still, you can use a tool like iconv to convert your files to the appropriate character encoding format.

I’ve configured some deployment servers to use SSH over non-standard SSH ports and that can really be a problem when you want to use that with git. No matter what you do, git would always attempt to connect through the standard SSH port 22.

There was really no point in scratching my head and trying to pull my hair out in order to fix this. So I googled a solution. This post gave me a hint but wasn’t helpful enough so I decided to write a blog post on how to go about solving this.

You’ll have to configure your repository in your .ssh/config file. Here’s an example. Simply substitute the #*# placeholders for the actual values

Host #hostname#
  User #username#
  Hostname #hostname#
  Port #non-standard port#

And if you prefer to use private keys to login:

Host #hostname#
  User #username#
  Hostname #hostname#
  Port #non-standard port#
  PreferredAuthentications publickey
  IdentityFile "#path_to_private_key#"

The blog post title says it all. My memory fails me as to the exact date the popular blog – StartupsNigeria.com went offline. There could have been several reasons why it was offline but one day, two days, one week… the site was still offline. I started to get a bit concerned. I began to hear rumors, but then, they were rumors and so paid little or no attention to them.

Afterwards, in discussing with the editor of the blog – Loy Okezie, I got informed that the site went offline due to a “conflict of interest” and yada yada.

I left it at that and celebrated with Loy Okezie when he launched StartupsNigeria.org. Updates on StartupsNigeria.org have been posted by Loy Okezie on his personal blog.

As things will take a different turn, I just got an IM from a colleague a few hours ago who drew my attention to a new blog post by Vic on the whole issue. After reading the blog post, I was more confused but more sad than confused about what the true story had been from the beginning. Right now, I’m so sad about seeing a very promising blog run down like this. Like Ope Awo wrote in his blog post on this, Loy Okezie was really building a brand of the types of Michael Arrington with Techcrunch but issues with integrity can really bring down an entire empire. I’m really sad about this whole development but hey I’m glad to see the impact the site had made while Loy was at its helms.

StartupsNigeria.com will never be the same again; nevertheless, it will not be a deterrent to the Internet revolution in Nigeria.

One of the big benefits of using source code versioning (or source code management systems) is that it allows you to maintain a history of all the changes in code and allows for easy collaboration amongst several developers on the same code base. SCMs will allow you answer the following questions:

  1. Who made what change
  2. What change was made
  3. When was the change made

If you happen to have a number of developers and you’re working on the same project (even if you’re the only developer, this helps) you like to know when a change to the source code breaks the application (this happens alot). Not only that, having an SCM allows you to easily revert that change. This post is not about SCMs but I thought it necessary to provide a little background information.

I recently started using git and have really loved it (although it’s not perfect, it does the job well). I prefer git over subversion (svn) for a major reason that it is distributed: does not require a connection to a server in order to commit to the repository.

Recently, I thought about migrating my svn repositories to git and I found a wonderful resource for that here. I’m not going to attempt to republish what has been said there here. Instead just point out a couple of things I had to do differently.

First of all, depending on the way your git is installed, these are basically the commands to run:

git svn init svn://server/repo/trunk/ --no-metadata
git config svn.authorsfile /path/to/svn-authors
git svn fetch

The difference here is to use git svn instead of git-svn. Also, if you happen to have blank authors (as I had in mine), then your svn-authors file should contain an entry similar to this:

(no author) = Firstname Lastname <emailaddress>

Webmasters out there, how many times have you ignored the advice to backup your site when making an upgrade? Trust me, if you continue (like I’ve been doing) that way, it will come back to bite you one day.

Earlier today, I wrote a new post on this blog and having ignored the blog for a while, I noticed that there was a new upgrade for WordPress (the software that powers this blog) and I thought – “Hey why don’t I do some site maintenance in the process.” and there I went to click on upgrade automatically. I (like I usually do) ignored the advice to backup the site before upgrading and just clicked through. For some reason (I thought my Internet connection broke) the process didn’t display a success status but I assumed it went well.

Thanks for my friend Tunde Adeyemi (@barbietunnie) who pointed out the fact that the site was broken and needed fixing. I quickly replaced the site with a “We’ll be back soon” banner page and went about fixing it. Thankfully, nothing was damaged and the process took less than 30 minutes. So next time you want to do upgrades (especially when it involves the core), do take the advice you’re given.

Can I see a raise of hand if you use the same password on more than one website? Oh you even use the same password on all websites? Terrible!

Have you ever considered what the consequences will be if a rouge web developer attempts to use that same password you used to register on his website to login to your email? It could be worse.

The problem is that there are numerous websites out there and though I could say use random passwords, you’ll soon have to use the password recovery utility on every website you have an account on as you wouldn’t be able to remember all the passwords.

One solution, is to use a password manager. I’ll personally recommend KeePass – which is a utility that enables you to generate and/or store your passwords securely. It has a number of good security features that even helps to mitigate the activity of key loggers, perhaps they are installed on your system.

Alternatively, I will suggest the use of an online utility like Hashapass. The reason I’m excited about this is because it allows you to use a password you remember and combines this with some other information (e.g. the domain name like cnn.com) to generate a hash that can then be used as a password to the site.

If you had an account on say gmail.com, and you used a master password of say jackass, entering in this information into the Hashapass generator will generate the password: y/NTQTnm. Not bad hmm? yahoo.com as the parameter generates DyPh7Z5d. Completely random and very difficult to guess. All you need to remember is your master password. Better still, the bookmarklet will even make it easier to use the service without having to first visit the website.

I remember the first time I used Google Maps. I was thrilled with the ability to find places and locate them on a digital map. That was my first exposure to Geographic Information Systems. But I quickly grew out of it after a while and what was majorly because of the lack of localized information.

Roadmap as appeared on Google Maps on 22 March, 2009

Victoria Island roadmap as appeared on Google Maps on 22 March, 2009

I dabbled into Google Maps mashups and built my first Google Maps application when I was working on my final year project in the University but then I saw little use for it locally.

A few months back, Google announced a community-based mapping project known as Google Map Maker. Google Map Maker enables the people who live in areas that have not been well covered by Google to map their localities using the tools that Google has provided. The implication of this is that you now have the ability to map your village, if you wanted to.

Google Map Maker tile of Victoria Island as at March 22, 2009

Google Map Maker tile of Victoria Island as at March 22, 2009

What’s the motivation?

That’s a rather interesting question because I never really gave thought to it when I started creating maps using Google Map Maker but in giving thought to it, I realized that in providing local content on the Internet not only does it makes the Internet richer but it also provides value for the locals. I earlier mentioned how the Mapping service was of little use to me because there wasn’t local data but now, with other people mapping different areas within the country, I am able to determine routes before setting out (for instance).

I remember a particular day I was to meet up with someone somewhere in Lagos Mainland. He described the point of meeting as around the intersection of Opebi Link Road. I wasn’t sure of the location but then I thought “worst case scenario, I’ll ask someone about it.” I decided to put Google Map Maker to the test. I did a search for Opebi Link Road and voila, it showed me the location and I was able to know where it was and how to get there.

Imagine then that you are looking for the nearest branch of a particular bank. Apart from having to consult the list of branches from the bank’s web site, you can look it up on Google Map Maker. Now eventually, the information will be integrated into Google Maps proper but for now, everything is still available on Google Map Maker.

So what happens if the information you are looking for is not available? Add it! There’s no reason why your company’s branches or building (or other features like street names, restaurants, churches, mosques, entertainment venues, etc) is not tagged on the map. Information is being added to the map on a daily basis and your contributions are not only helping give your company visibility, but it’s also adding value to others who might find that information useful when the need arises.

It’s simple – visibility.

Loy Okezie recently published a blog post listing a few of what he thinks to be the top 100 web developers in Nigeria. I found the comments to be very educative and interesting.

I happen to know virtually everyone on that list and while some comments on the site and elsewhere were such that the author was partial, there’s something very important here that I wish every other developer (that was nominated) will do something about – Get visible. The people on that list were there because Loy happened to know about them. Loy hasn’t met a number of them physically but using online interaction tools and social networks, he’s been able to get to know them.

After reading the comments on the blog and the discussion forum, I was happy to know that there are people making a difference all over Nigeria but they need to get visible and let the whole world know what they’re doing. At the very least, I expect these web developers to have a Twitter account (since I refer to it as a blog for lazy bloggers) and better still a blog. If they are very ambitious, they can go ahead to have a proper web site with profiles of what they’ve done, a blog and so on.

Here’s the synopsis, I have a web development machine that has a NAT connection to the Internet and what that means is that I cannot access the machine directly from the Internet. So if I wanted a friend or colleague to test my work or say I’m at someplace remote and want to be able to view my web application, that will not be possible. However, using some techniques (which I will describe in this post), you can actually make this machine accessible on the Internet.

Here are certain assumptions:

  1. You are using Windows XP or Vista as your local machine.
  2. You have a Linux/UNIX host as your remote machine.
  3. You are using the Apache web server on both machines.
  4. You have basic Linux/UNIX administration skills.
  5. You’re comfortable with basic level Apache configuration and know what .htaccess is.

Step 1

First of all, we will be using a technique known as SSH port forwarding. This makes it possible to have an SSH server that has a public routable address (public IP) to forward an arbitrary port number to our local machine. For this demonstration, I chose to forward port 8080 on the remote machine to port 80 on my local machine.

SSH servers by default are now being configured in such a way that this forwarded port is only accessible from within the remote machine (AKA localhost). In order to ensure that this forwarded port is accessible to any machine connecting from the Internet, you need to tweak the settings of the SSH server running on the remote machine.

Simply edit the /etc/ssh/sshd_config (the path may be different) file on the remote machine and comment out the line GatewayPorts no. Change the value from no to yes. Save the file and reload the SSH server.

Step 2

Next on your local machine, you will need to create the SSH tunnel to the remote machine. This can easily be done using the plink application in the PuTTY suite of applications. Please visit http://www.chiark.greenend.org.uk/~sgtatham/putty/

Simply launch the plink application from your command prompt using the following syntax:


plink -R %REMOTE_PORT%:%LOCAL_IP%:80 %USERNAME%@%SERVER_ADDR%

%REMOTE_PORT% is the remote port you wish to forward. In my case it was 8080.
%LOCAL_IP% is your local machine’s IP address. In my case, I simply used the localhost IP – 127.0.0.1
%USERNAME% is your username on the remote machine and %SERVER_ADDR% is either the IP address or hostname of the remote machine.

Once you’ve logged in, the port on the remote machine is forwarded to your machine. If your web server is running on a port different from 80, change the syntax accordingly.

You can test connectivity by going to http://%SERVER_ADDR%:%REMOTE_PORT%/. This should display contents from your local web server. If you wish to simply use this, you’re fine but if you want something cleaner and more invisible, then you’ll want to proceed.

Step 3

Next step is configuring your hosting account (a subdomain will be best) to proxy requests to your local machine’s web server.

Create your subdomain and navigate to the document_root of that subdomain. Edit/create a .htaccess file and put the following into it.


RewriteEngine on
RewriteRule ^(.*)$ "http://%DOMAIN%:%REMOTE_PORT%/$1" [P,L]

Here, %DOMAIN% is either localhost or your domain/subdomain (which of course should have previously been configured to point to the remote machine), %REMOTE_PORT% is the remote port configured on the remote machine. The magic being performed here is done by the [P,L] directive that proxies any requests to the local machine through the tunnel accessible from the remote port. The $1 parameter passes on any url parameters to the local web server.

Once this has been completed, visiting http://%DOMAIN%/ will bring up content from your local machine. This is made possible by virtue of the proxy features in the Apache web server.

Step 4

This final step is only needed if you intend to be able to log the original ip address the request came from before the proxying was done.

This involves modifying your local machine’s web server configuration.

Simply locate the VirtualHost or main configuration section in the Apache configuration file and add this:


LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxylog
CustomLog logs/custom-access.log proxylog

This directive is a modified combinedlogs directive to use the HTTP_X_FORWARDED_FOR header parameter instead of the IP address in logging the request.

Save the file and reload/restart your web server.

I can’t remember exactly how I stumbled upon (no pun intended) this very exciting news but I did realize that this had been out since January and I only got to know about it today and that’s precisely the reason why I’m blogging about it.

It’s come to my notice that a lot of good, exciting, newsworthy things go on around us on a daily basis and we are almost completely oblivious to them. I believe that if you find something (a resource, a link, a download, whatever) that is useful not only to you but to someone else, publishing it (or telling about it) is doing great service. Those in the Social Network Services (SNS) space like to call it social bookmarking.

Google’s free SMS search is a service that enables you to access a number of Google’s search features online through SMS. So you could do things like language translation, check the meaning of a word, check the latest headlines, retrieve latest sports scores and even lookup Bible passages with it – all via SMS.

Why am I excited about it?
As at 2007, Africa had over 280 million mobile subscribers (Source: Blycroft Ltd.). GSM subscriber growth has been at an average of 62% annually (Source: http://www.gsacom.com). A considerable number of the handsets used in this region have basic functionality – voice and text. Due to their lack of complex features like web browsers, you could say that these devices are not capable of accessing data-rich applications.

Not so anymore. With Google SMS, handsets that were unable to access the mobile web have a chance of accessing useful online information. Whether it’s weather updates or latest sports scores, all this information can be retrieved using text messages.

What’s also great about it?
When a content provider provides a service via shortcode, the default pricing comes at about ₦50 or ₦100 per query. I was impressed when I learned that Google SMS search was doing ₦10 per query. Anyone who’s looking to retrieve vital information can now do so cheaply.

What else could be done?
I went through the list of services being offered and to be sincere, these are not the kind of services people around here will likely consume in large numbers: weather, glossary, translation, calculator? Ok maybe sports scores can be appealing to those who are on the move and will like to keep track of the scores of one of their favorite games but if local services that provide real value can be developed on this platform, we are looking at very good patronage. An example will be providing local listings search. It will be useful if anyone can search for certain businesses or products in their neighbourhood using the Google SMS service. This is just one of the many local services that can be provided.

How to use the service
To find out more information on how to use Google SMS search, please go here.

About this blog

Tim Akinbo's Weblog is the personal weblog of Tim Akinbo. Here he discusses issues relating to technology. Special interests include the web, mobile technology and location based services.

Photostream

    Panel Session on Realizing Nigeria's Internet PotentialDelegates during Justin's Keynote PresentationBarCamp Attendees 1main hallmain hall 2main hall 3
  • Daniel: Thanks Tim for coming over! Icant $get that day to me that was like a boost to my skills I was thnki [...]
  • Iyinoluwa Balogun: i think curiousity comes first. those who have left footprints in the sands of time started by quest [...]
  • Kizito S.M.: What I gather is that this G-Buzz is something like a blend between Facebook Updates and Twitter fol [...]
  • concept37: They are trying to out-facebook facebook and out-twitter twitter, Folks who want to do these things [...]
  • ray: Funny u took it from the LBS angle, which makes better sense. But from the social networking perspec [...]

Subscribe to this blog via email

Enter your email address: