Mobitel: All sweet talk

A couples of months back, we switched from using Swift Networks to Mobitel for our Internet access and that decision was made mainly because of poor service coverage at our office. The first few days were great! Even though we didn’t have excellent signal, the service was usable. During week days, we never got speeds that were advertised. We had initially subscribed for their 3Mbps bundle but when we realized we weren’t getting anywhere near those speeds, we decided to go for the 2Mbps bundle. That took over 24 hours to effect. We lost a day of productivity.

In the ensuing months, service degraded drastically and we experienced serious network outages. There were several complaints and after about two weeks, they eventually pinpointed the problem to be a cut fibre cable. Service got restored after a few days.

What had always been an issue for me with Mobitel, was the fact that there was no quick and easy way to pay for subscription and get activated not to even mention the quite incompetent engineers they seem to have hired (that’s a story for another day); when an ISP has a policy that you cannot change settings like your SSID or password on your modem, then that should give you some concern. Anyways, I was really excited when I read the announcement of the provision of a quickteller option for payments. Awesome! I thought, this should be quick and painless. It’s over 24 hours now and we’re yet to receive activation. All the customer service reps keep telling us is that they’re experiencing some “downtime” and they’ll work on it ASAP and all that.

Now I keep asking myself if we did the right thing to have switched providers.

September 7, 2011  6 Comments

Gamebook: Superman Finds a New Arch Enemy

 

 

Source

September 4, 2011  2 Comments

Amazon Promises To Create 7,000 Jobs If California Punts On Web Sales Tax

This just goes on to show you how powerful corporations are in regards to government policies.

Amazon.com has said it will add 7,000 workers to its payrolls in California, but only if the state agrees to temporarily postpone implementation of a new sales tax on online purchases.

September 3, 2011  Leave a comment

Not using SSL? Why not?

First and foremost, if you’re collecting sensitive information from your Internet users (sometimes even a username and password could be deemed very sensitive) and aren’t using SSL, you’re doing it the wrong way and potentially exposing your users to all sorts of security risks. I’ve also heard about administrators complaining about how costly it is to get SSL certificates these days – yes that could be excusable but not anymore. Some people useĀ self-signed certificates but I generally advise against it unless you have educated (or savvy) users – browsers don’t help much with the intense warning they emit when a user attempts to visits such a site and that’s because the browsers don’t trust the certificate – anyone could forge one.

Well the good news is that you can get a recognized certificate for your server for free. An amazing company called StartCom allows you to create basic certificates that are recognized by all the major browsers for free.

Here’s a guide on how to go about the process.

Oh and if you ever needed higher class certificates (Class 2/3) or even Extended Verification (EV) certificates, they’ve got them and it will only cost you about a tenth of what it would cost to get the same certificate type from other vendors. Do check them out.

September 2, 2011  3 Comments

How I implemented a multi-master MySQL replication setup using the poor man’s VPN

The folks at my company and I recently deployed a web application for a client. During initial discussions, we were made aware of the fact that most of the users of the application will be accessing the app from one location. We couldn’t have the application hosted in-premises because there were components of the app that needed to be online all the time and accessible from the Internet. Given the conditions under which hosting the application in-premises will be subjected to, we decided to have the app hosted on a VPS. Performance, however was key and given that the location was likely to have a poor Internet connection, we then decided to have two servers – one for the version that was hosted externally and another for the in-house version. Since the application was essentially the same, we didn’t have to create two application versions but synchronizing the databases was going to be key.

Up until now, I had never implemented a MySQL replication setup before and knew only about one-master-multiple-slaves-type replication using MySQL. I was planning of using PostgreSQL for the multi-master replication setup until I discovered a way to implement multi-master replication in MySQL.

This setup works on the premise that both machines are able to “see” each other – meanining I can connect to the MySQL instance running on each of the machines from the other. In our scenario, we were dealing with a server that was on the Internet (which the local server didn’t have any problems connecting to) and another server that was behind a firewall at the client location – which meant that the Internet server was incapable of connecting to the MySQL instance on the local machine. Also in this case, port forwarding was not an option.

Solution

SSH tunneling is fondly called the poor man’s VPN because with it, you can setup tunnels that will allow you gain access to services running on a local server from the Internet. With a simple:

ssh -R 8000:localhost:8000 username@remoteserver

Issued from a local machine to a remote server with an Internet reachable IP address, a service hosted locally on port 8000 finally becomes accessible from the remote machine. In the case of making MySQL running on a local machine accessible from the remote server, this can be accomplished by using the syntax:

ssh -R 3307:localhost:3306 username@remoteserver

and now you can connect to it from the remote server:

remoteserver username$ mysql -h localhost -P 3307 --protocol=TCP

It’s sometimes essential to specify the connection protocol as MySQL tends to use the UNIX pipe to connect to MySQL by default and that would mean that it will connect to the MySQL server running on the current machine irregardless of the -P option.

I configured autossh to automatically connect to the remote server on startup and reconnect if the connection gets severed for any reason. Because of the unstable Internet connectivity, I configured a cronjob to always attempt to connect to the remote server in the event that it’s unable to do so at startup.

What was left, was to configure the right master settings for each of the servers. The only difference was the addition of master-port in the mysqld configuration file to specify which port to connect to the master. In the mysqld configuration file for the remote server, I set master-port to 3307 and master-host to localhost. On the local server, I configured master-host also to localhost and master-port to 3307. This was for the sake of consistency. So I was able to do this because I had created a tunnel linking port 3307 on the local machine to port 3306 on the remote server and port 3307 on the remote server to 3306 on the local server.

Remote server mysqld configuration

auto_increment_increment = 10
auto_increment_offset = 1
master-host = localhost
master-port = 3307
master-user = <replication user>
master-password = <replication password>

Local server mysqld configuration

auto_increment_increment = 10
auto_increment_offset = 2
master-host = localhost
master-port = 3307
master-user = <replication user>
master-password = <replication password>

After this setup and sorting out some replication-related issues, both servers started synching with each other and it performs pretty well even with a 128k link and with lots of activity on both servers. The only issue I’ve had is with the timestamp fields, they seems to always have the same minute (e.g. 10:02, 23:02, 13:02) and I’ve not been able to figure out why.

Are there other (better) ways this could have been implemented?

February 28, 2011  2 Comments

« older posts newer posts »