Archive for the ‘Internet’ Category

PHP Composer on a Hostgator Shared Account

Posted on the October 14th, 2013 under Internet,Linux by

If you were to try and install composer on a Hostgator Shared Account, you’ll likely get an error like below:

Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in – on line 399
#!/usr/bin/env php
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:

The phar extension is missing.
Install it or recompile php without –disable-phar

Your PHP (5.2.17) is too old, you must upgrade to PHP 5.3.2 or higher.

The problem is that PHP 5.3 is not the default, but it is available. To install, run instead:

curl -sS | /opt/php53/bin/php

Which results in:

#!/usr/bin/env php
All settings correct for using Composer

Composer successfully installed to: /home/tohir/www/
Use it: php composer.phar

Lastly, when you are running composer install, the command needs to be:

/opt/php53/bin/php composer.phar install

Sample Output:

Installing dependencies (including require-dev) from lock file
– Installing respect/validation (dev-develop 3956203)
Cloning 39562034bd5cb692289f603bac8766f4d167426e

– Installing slim/slim (2.3.1)
Downloading: 100%

Generating autoload files



Starting a VNC from the command line

Posted on the July 18th, 2013 under Internet,Linux by

It’s great to remote desktop/VNC into another server and doing work via a visual desktop interface rather than the command line, but this often requires that the VNC be started from the desktop interface. Here’s how to start the remote desktop from the command line. This is with Ubuntu 10.04.

Instructions (Bold+Italic is for command):

1) SSH Into Machine

2) Become Root: sudo -s

3) export DISPLAY=:0.0

4) xhost +

5) Exit from root: exit

6) export DISPLAY=:0.0

7) nohup /usr/lib/vino/vino-server > /dev/null &


I know Ubuntu 10.04 is old, but that’s the context where the need for this arose in. Also, please note there is security implications when using remote desktop. Please Google that

Installing Zend Server CE on Ubuntu Maverick (10.10)

Posted on the January 24th, 2011 under Internet,Linux by

Spent the day trying to install Zend Server on Ubuntu (10.10), but ran into so much blockers, thought it would be worth a blog!

After following all the steps, I got hit with:

W: Failed to fetch
Unable to find expected entry  non-free/source/Sources in Meta-index file (malformed Release file?)

Kept trying sudo-apt-get update whilst cursing Zend, and still the same.

Solution: Disable the sources repository in /etc/apt/sources.list.

#deb-src ce non-free

Next, trying to install, and keep getting dependencies issues. There are two (old files) that need to be downloaded, and then everything works fine:

They were in older distributions, but no longer are!

Once those two files are manually installed (sudo dpkg -i), the rest is plain sailing.

Why CSS gets confusing and why you should use SASS

Posted on the September 30th, 2010 under HTML, CSS,Internet by

Take the following HTML file with CSS. How will div2 look?

<html lang="en">

<title>SASS Test</title>

<style type="text/css">
    div.div1 div {
        border: 4px solid yellow;
        background: yellow;
    div.div1 {
        background: red;
        border: 4px solid blue;
    div.div1 div.div2 {
        background: green;
    div.div2 {
        border: 10px solid orange;
        padding: 10px;
    <div class="div1">
        Div 1
        <div class="div2">
           Div 2

Based on the last definitions, you will expect div2 to have:

  • a green background color
  • a 10 pixel solid orange border
  • a padding of 10 pixels between the border and the text

Actually it will appear like this:

It does NOT have a 10 pixel solid orange border, but instead a four pixel solid yellow border. Even though CSS is cascading, it cascades by CSS rules, not by definitions. Even though an alternate definition is last, if it doesn’t cascade over an existing rule, it will not be applied.

Wireshark Filters – Ajax Example

Posted on the September 30th, 2010 under Internet,Linux,Software and Technology by

I’ve blogged about Wireshark before, and how to use it for Ajax. Next is a quick tip on how to use Wireshark’s filters feature to only watch for AJAX requests. In the filter tab, enter:

http.request.uri contains "php" ||  http.content_type == "text/html"

This effectively reads, only log items where:

  1. The HTTP request contains PHP, OR
  2. The HTTP response is “text/html”

Wireshark Filters

Useful, dont have to wade through whats an Ajax response, bypass images, etc. One thing that would be nice would be if the area that shows the filter expression was longer!

Preparing For Hajj – Some tips for techno hajjis

Posted on the September 27th, 2010 under Internet,Islam and Muslims,Reflections/Thoughts,South Africa by

Going on Hajj nowadays is so much different from years ago. As someone that was fortunate to be there in 1995 and last year (2009), the differences were stark. No longer did we have queue for prepaid phones, we could video chat (skype) with our family back home. No longer did people have to wait for photos to be developed. We shared them immediately on Facebook. And yes, we took photos of ourselves inside the Haram and MMS’d it home!

Opting to take our gadgets also came with its own preparation. Having learnt from the advice of well-wishers, as well as mistakes from previous trips, here are some tips we can offer.

Electricity – Get a Travel Plug Converter

Saudi Arabia uses the Type F plug, South Africa the Type M. One Hajji noted that his hotel also had the Type G plug (as used in the UK), but this is very rare.

I found a travel plug converter at Diskem, but its generally available at stores like Cape Union Mart. Also try places that sell suitcases. Type G to Type M is easier to find and available at Clicks for instance, but rather take the Type F. This also makes a handy gift to Hujaaj!

We also took with a multiplug allowing us to comfortably power the laptop as well as charge our cellphones, camera battery, electric tooth brushes, electric shavers.

Saudi Arabia also uses 220V so there’s no need to change the voltage on your equipment.

Type F Plug

Type F Plug

Type M Plug

Type M Plug

Type G Plug

Type G Plug

WiFi and Internet

Even if Wifi is advertised  free in your hotel, it may only be available on a certain floor. Check with your travel agent whether the hotels you are staying in offer WiFi and whether WiFi is offered on all floors or just some. I found WiFi more available in Medina than in Makka. It may be because of the construction work, but speculation on my side.

Internet on your Cellphone

Have a habit of quickly checking Facebook on your cell phone, I was shocked to see how expensive this is with airtime just running away. My guess is that it costs something in the region of Rs2 (Saudi Riyals) a megabyte which would be more expensive than South Africa.

Tip: Keep this is mind that their billing rate may be different. Also check your airtime balance regularly, and modify the settings of programs that connect to the Internet. In my case, one of them was one that downloads the daily weather.

3G Internet for Your Laptop

It is possible to take your 3G card with and purchase a one 30 day data bundle from a service provider in Saudi Arabia. There are two advantages to doing this:

  • If your hotel does not offer WiFi on your floor, you can comfortably Skype and video chat with your family in the comfort of your hotel room.
  • If your package involves moving to Azizia, you’ll have Internet access there! Azizia is nice, but WiFi is not standard there 😉

Some tips on purchasing a data bundle

1) Saudi Arabia has two main operators: STC and Mobily. STC is the equivalent of Telkom, advertises everything but has nothing and unlikely to help you if they sense you are going to make them THINK or do some real work. The service from Mobily on the hand was wonderful. They knew their products, no queues.

2) Purchase the data bundle in Medina

Makka is full. Since it is also winter there, there is a shorter time between the Waqts and also to get to the Haram on time. By the time you get to the front of the queue, its time for Salaah. However, try and purchase it closer to the end of your stay in Medina, but with enough time to go back to them if any issues arise (about three days before you leave). A data bundle lasts for 30 days. The later you purchase your data bundle, the later for your stay in Makka you can use it. Otherwise you run in the dillemma of wanting to purchase a data bundle just a few days before Haj and risk losing the balance of data/airtime.

3) Requirements

I purchased the data bundle at the Mobily Store in Central Medina (opposite the Hilton hotel). They required a photocopy of my passport (which I did not have) but accepted my Al Anwar card. Best to take a photocopy of your passport with.

4) The connection settings for Mobiliy is built into Ubuntu, just setup a Mobile connection. For Windows users, they are:

Number: *99#
APN: web2

However, the pamphlet given is quite handy. The salesman will also tell you that you can bring your laptop to them and they will help you set it up!

AIR Time

Recharge Card

Recharge Card

Airtime is sold in various denominations. However, if you buy a larger, you stand to gain extra airtime. For example, a Rs100 airtime card gives your Rs150 airtime (cant recall exactly, but it was in this region).

Best of all, the cards have two scratch areas, so even if it is a single card, the airtime can go on to two phones. As they say in Cape Town, “Klap together”.

This also offers the opportunity for the budding entrepreneurs in Makka and Medina. Check that you are not paying the extra Rs50 when you dont have to. Also, some of them will sell you half the card for Rs75. There are so many of them, just walk away and move to the next guy.

Internet Banking

The number one rule: Update your profile to receive your One Time Password (OTP) via email. By default, most people receive their OTP via SMS. Unless you have international roaming activated and WORKING, you may not receive this, which may stop you from performing any transactions via the Internet.

Standard Bank users can only opt to receive their OTP via SMS or email. FNB users have the option of receiving the OTP via email in addition to SMS.

However, for both of them, you need to setup the OTP via email before leaving your hometown. Usually someone from the branch has to phone you, ask you to verify your details, etc. before they set this.

For Standard Bank, if you set up a recipient, you will not need to enter a OTP when doing a transfer to them.

ATMs, Banking in General

Please check that your card does not expire whilst you are on Haj. Banks usually have your new card a month before they expire, and you can request them to send you one earlier as well.

You are able to do cash withdrawals at Al Rajhi bank. In Makka, they are situated in front of the Hilton hotel. In Medina, there’s an ATM on the first floor of the Hilton Hotel. In most of the more modern malls, they do accept cards. Some of the smaller shops usually share one machine that services a group of them, so you may have to walk to another point to have your card swiped.


Make a checklist of all the wires and cables you need to take with. Its annoying to be on the other side of the world only to discover you dont have a cable you need.

Back Home Preparation

Apart from checking that you are hooked up, ensure that your family is likewise. Are they able to connect to the Internet, start skype, etc.? Does their webcam give a grainy or feed, etc.? Run a few checks before you leave, and also put them in contact with someone thats knowledgeable. If they are going to use someone else’s Internet connection, ensure that you have budgeted for this as well.


Where possible, assist your fellow Hujaaj if you can. The Holy Prophet Muhammad (PBUH) said that the best of people are those who assist others, and how much greater is this in the Holy Cities. If you find any of these tips handy, please make Duah that the Almighty grants the author to apply these tips himself in the Holy Lands, Insha Allah

[Video] Shaykh Sadullah Khan’s Khutbah at Claremont Main Road Masjid

Posted on the September 4th, 2010 under Internet,Reflections/Thoughts by

The khutbah is available online, but sometimes it’s just easier to watch it online.

Blocking Search Results in Google

Posted on the May 20th, 2010 under Internet,Software and Technology by

I find it quite annoying that when ever I do a search related to ExtJS, two sites ( and are on the first page of results. These two sites simply aggregate ExtJS forum posts, and then present them in a SEO friendly page.

Given this, I took to finding a way that can block search results. Officially, there’s no way you can do that from within Google settings (which would have preserved that as you moved from machine to machine), but there are extensions for Firefox. Still looking for a Chrome one!

For Firefox, there are a few extensions. One is CustomizeGoogle, but it doesnt work in the latest version of Firefox.

The one that does work is SurfClarity. It allows you to list of a sites that should be filtered out. It doesn’t do it from the server-side which would save a 1kb of traffic, but nonetheless is good enough.

How to Loop through the Properties of an Object in JavaScript

Posted on the May 10th, 2010 under Internet,JavaScript by

for (var key in object) {
    alert('value of '+key+' is '+object[key]);

Wireshark and [truncated]

Posted on the May 10th, 2010 under Internet,Linux by

I’ve posted a tutorial on how to get wireshark up and running on Ubuntu. The one problem , though, is that sometimes (actually often) you get [truncated]. How can you untruncate or turn it off or increase its size.

This isn’t the answer, but a way of how to get access to the full response:

Right Click on the Packet in Line-based text data, then choose Copy > Bytes (Printable Text Only).

This will place the full response, and you can paste it in a text editor.