31 December 2009

Product suppliers can also provide backlinks

Search engines reward websites that are well linked. Search engines operate under the assumption that if many other websites link to yours then that reflects a measure of trust and value in your site content. This means that building up these links to your website is an important task for any website owner.

Finding relevant sites to approach for a backlink can be a difficult prospect.

Reciprocal linking

Many reciprocal link exchanges end up being an exercise in spam management as completely inappropriate sites approach you for a link. Reciprocal linking is actually a risky affair. Google specifically warns against creating pages for reciprocal linking in its Webmaster guidelines. It's pretty obvious why reciprocal linking is discourage - it is an articifical distortion of a person's desire to link to your content. They're not linking to you because you have valuable content, they're linking to you in exchange for a favour.

One way links

Clearly one way links are much more desireable, but where can you find people willing to do this?

One place to look is to approach all of your business suppliers. You've probably built up a relationship with them and having them link to your website will just be a reflection of this relationship. Remember that if your website is relavent to their users they should be willing to link one-way to you.

One way that people suggest as a way to get a backlink is to provide a testimonial in which your link appears. Your supplier can then place the testimonial on their site and provide a link to you.

Who are your suppliers? It may take a little digging to identify all of your suppliers but the potential reward of relevant backlinks should be enough to motivate you to picking up the phone.

If you'd like to find out more about SEO please feel free to contact me.

30 December 2009

"Word of the Day" PHP script (with word list)

I was looking around for a way to generate a word of the day on the web and didn't find anything. So I coded a quick and dirty script to do it.

Just in case anybody does a Google search and manages to find my blog: here is my Word of the Day PHP script:

Copy this code snippet into a wordoftheday.php file:

$file = fopen("interesting_words.txt","r");
$raw_string = fread($file,filesize("interesting_words.txt"));
$words_array = explode("|",$raw_string);
echo $words_array[array_rand($words_array)];

Of course the real issue I had was finding a list of interesting words in the right format. Here is the list of interesting words that I used:

Copy this into a file called interesting_words.txt:

ubiquitous : being or seeming to be everywhere at the same time; omnipresent|
ecdysiast : a striptease artist|
eleemosynary : of, relating to, or dependent on charity|
gregious : conspicuously bad or offensive,bailiwick : one's particular area of activity, interest, or authority|
animadversion : strong criticism; a critical or censorious remark|
gallivant : to roam about in search of pleasure or amusement|
zephyr : the west wind; a gentle breeze; something that is airy or insubstantial|
borborygmus : a rumbling noise produced by the movement of gas through the intestines|
Godspeed : success or good fortune|
schadenfreude : pleasure derived from another's misfortune|
merkin : a public wig for women|
dollop : a shapeless mass or blob of something|
porphyrophobia : fear of the color purple|
perspicacious : having keen judgment or understanding; acutely perceptive|
senescence : growing old; aging|
poltroon : a contemptible coward|
pilgarlic : a bald:headed man|
boeotian : stupid; dull|
contumely : rudeness or contempt arising from haughtiness; insolence|
lucubrate : to study diligently; to write in a scholarly way|
undulation : movement in waves; a wavy, curving form or outline|
weanling : a child or animal newly weaned|
euphony : agreeable sound|
quixotic : extravagantly chivalrous or romantic|
stentorian : very loud|
perambulate : walk through, about, or over; stroll|
jocularity : joking speech or behavior|
mendacity : a lie; falsehood|
obloquy : verbal abuse of a person or thing|
ribaldry : coarse language or humor|
pusillanimous : timid or cowardly; fainthearted|
heebie:jeebies : nervousness; jitters|
scalawag : scamp; rascal|
mulct : to swindle; to defraud|
corpulent : excessively fat|
cacology : bad choice or use of words|
aberrant : deviating from the proper course|
mellifluous : sweetly flowing; smooth and sweet|
quidnunc : a busybody; a nosy person|
solipsism : the belief that the self is the only reality|
ricochet : to rebound|
prandial : relating to a meal, esp. dinner|
propinquity : proximity; nearness|
persiflage : banter; light, good:natured talk|
officious : meddlesome; unnecessarily or obtrusively ready to offer advice or services|
odious : repugnant; hateful|
ennui : boredom; listlessness|
reconnoiter : to make a preliminary inspection; to look around|
callipygian : having beautifully proportioned buttocks|
steatopygian : having an excess accumulation of fat on the buttocks|
phalanx : a compact group of people|
troglodyte : a cave dweller; recluse|
penultimate : next to last|
chthonic : of or relating to the underworld|
tergiversate : to equivocate; to change sides|
jejune : not interesting, dull, empty; childish; lacking in nutrition|
otiose : lazy, indolent; useless; ineffective, futile|
salubrious : conducive to health or well:being|
kakistocracy : government by the worst or least qualified citizens|
hebetudinous : dull:minded; mentally lethargic|
uxorious : excessively fond or submissive to one's wife|
quotidian : daily; everyday; commonplace|
logorrhea : excessive, incoherent talkativeness|
ichthyophagous : feeding on fish|
mammiferous : having mammary glands|
tatterdemalion : a ragamuffin|
abacinate : To blind by putting a hot copper basin near someone's eyes|
abderian : Given to incessant or idiotic laughter|
abecedarian : A person who is learning the alphabetv
abligurition : Excessive spending on food and drink|
accubation : The practice of eating or drinking while lying down|
adelphepothia : An incestuous desire for one's sister|
adelphirexia : An incestuous desire for one's nephew|
adelphithymia : An incestuous desire for one's niece|
adoxography : Skilled writing on an unimportant subject|
aeolist : A pompous windy bore who pretends to have inspiration|
agelast : A person who never laughs|
agerasia : The state of looking younger than one actually is|
agraffe : The wire that holds the cork in a champagne bottle|
algerining : Prowling around with the intent to commit burglary|
alphamegamia : The marriage between a young woman and an older man|
anopisthography : The practice of writing on one side of the paper|
apodyopsis : The act of mentally undressing someone|
autohagiographer : One who speaks or writes in a smug fashion about their own life and accomplishments|
autolatry : The worship of one's self|
autotonsorialist : One who cuts their own hair|
basorexia : An overwhelming desire to neck or kiss|
bathykolpian : Deep:bosomed|
batrachophagous : One who eats frogs|
blandiloquent : Speaking in a flattering or ingratiating manner|
bletcherous : Pertaining to something poorly or disgustingly designed|
bombilate : To loudly hum or buzz continuously|
borborygmus : The rumbling sound of gas passing through the intestine|
brevirostrate : Having a short nose|
bromidrosis : Strongly smelling perspiration|
brontide : The low rumbling of distant thunder|
cachinnation : Loud or hysterical laughter|
cacoethes : A bad habit or insatiable urge|
cagamosis : An unhappy marriage|
cancatervate : To heap up into a pile|
capernoited : Slightly intoxicated or tipsy|
causeuse : A sofa built for two people|
charientism : An artfully veiled insult|
cheiloproclitic : Being attracted to a person's lips|
chirotonsor : An alternate title for a barber|
cleptobiosis : The act of plundering food|
clithridiate : Key:hole:shaped|
concilliabule : A secret meeting of people who are hatching a plot|
cruciverbalist : One who loves doing crossword puzzles|
dactylion : The tip of the middle finger|
dactylonomy : Counting using one's fingers|
decubitis : The act or attitude of lying down|
defenestrate : To throw out of a window|
dehisce : To burst open, as the pod of a plant|
dentiloquent : Pertaining to one who talks through their teeth|
dephlogisticate : To make something fireproof|
dippoldism : The act of beating or whipping school children|
dompteuse : A woman who trains animals|
eccedentesiast : One who fakes a smile, as on television|
estrapade : A horses's attempt to remove its rider|
exsibilation : The collective hisses of a disapproving audience|
farctate : The state of being stuffed with food (overeating)|
filipendulous : Suspended by a single thread|
floccinaucinihilipilification : The categorising of something that is useless or trivial|
fuscoferuginous : Having a dark rusty colour|
gambrinous : Being full of beer|
gargalesis : Heavy tickling|
gargalesthesia : The sensation caused by tickling|
ginglyform : Hinge:shaped|
gongoozler : An idle spectator|
gossypiboma : A surgical sponge accidently left inside a patient's body|
gowpen : A double handful|
hamartithia : Being likely to make a mistake|
hippopotomonstrosesquipedalian : Pertaining to extremely long words|
honorificabilitudinitatibus : With honour|
inaniloquent : Speaking foolishly or saying silly things|
interfenestration : The space between two windows|
jentacular : Pertaining to breakfast|
knismesis : Light tickling|
kyphorrhinos : Having a nose with a bump in it|
lethologica : The inability to recall a precise word for something|
liripip : The long tail of a hood in medieval or academic costume|
mallemaroking : The carousing of seamen on board Greenland whaling ships|
mammothrept : A child who is raised and spoiled by their grandmother|
misocapnist : One who hates the smell of tobacco smoke|
misodoctakleidist : Someone who hates practicing the piano|
mulligrubs : A state of depression or low spirits|
mumpsimus : One who sticks obstinately and wrongly to their old ways|
mytacism : The incorrect or excessive use of the letter M|
nelipot : Someone who walks without shoes|
nepheligenous : Producing clouds of tobacco smoke|
nidorosity : Belching with the taste of undigested meat|
nudiustertian : Pertaining to the day before yesterday|
oculoplania : Letting one's eyes wander while assessing someone's charms|
onychophagy : The habit of biting one's fingernails|
pandiculation : Stretching and yawning before going to bed or after waking up|
petrichor : The smell of rain on dry ground|
philosophunculist : One who pretends to know more than they do to impress others|
pogonotomy : The act of cutting a beard|
polyphloisboian : Making a lot of noise or loud racketv
preantepenultimate : Fourth from last|
prosopography : The description of a person's appearance|
psithurism : The sound of wind in trees or rustling leaves|
pyknic : Short and fat|
qualtagh : The first person you see after leaving your house|
quidnunc : One who always wants to know what is going on|
quomodocunquize : To make money by any means possible|
recumbentibus : A knockout blow, either verbal or physical|
runcation : The act of weeding|
sabrage : The act of opening a bottle with a sabre|
saprostomous : Having bad breath|
scacchic : Pertaining to the game of chess, or to chess pieces|
sciapodous : Having huge feet|
scolecophagous : One who eats worms|
sgiomlaireached : The habit of dropping in at mealtimes|
slubberdegullion : A filthy, slobbering person|
sphallolalia : Flirtatious talk that leads nowhere|
tachyphagia : Fast eating|
tarantism : An urge to overcome melancholy by dancing|
tetrapyloctomy : The act of splitting a hair four ways|
thelemic : Permitting people to do as they like|
ulotrichous : Having very wooly hair|
ultracrepidarian : Of one who speaks or offers opinions on matters beyond their knowledge|
usufructuary : A person who has use or enjoyment of something, especially property|
ventripotent : Big:bellied, gluttonous|
vigesimation : The act of killing every twentieth person|
wanweird : An unhappy fate|
witzelsucht : A feeble attempt at humour|
xenobombulate : To malinger|
xerophagy : A diet of bread and water|
xylopolist : One who sells wood products|
yclept : By the name of; called|
zenzizenzizenzic : A number raised to the eighth power|

I just love the array_rand() function. It's so much neater than doing $my_array[rand(0,sizeof($my_array))];

Ruby on Rails resources

Installing Ruby

For Windows users the quickest way to get Ruby running on your box is to get Instant Rails which provides you with a development platform right out of the box. Mac users can use Locomotive. If you're using Linux and don't know how to manage packages then install a GUI, shave your head, and pretend you actually like Macs.

Getting started

If you're like me you will want to try Ruby before reading a more thourough guide or online book. Then maybe have a look at database access before spending some time reading a Ruby blog. There are a number of Ruby forums online.

Cheating at ruby

This Ruby cheat sheet is a 14 page PDF that will act as a quick reference. This resource website will also allow you to quickly develop your skills.

29 December 2009

Creating layered images in C#

I'm currently developing a mobile site for a client. The site is the frontend for a competition that they will be running in 2010.

Part of the project specification requires the user to be able to build an image by choosing a background, foreground, and slogan. The site will then composite these images and enter the result into the competition.

In addition the site will send text messages to the users cellphone informing them of their status and (if they elect to receive it) a "word of the day"

This is probably the closest C# solution to what I was looking for:

public Image LayerImage(Image Current, Image Layer, Int32 LayerOpacity)
Bitmap bitmap = new Bitmap(Current);
Bitmap layer = new Bitmap(Layer);
Color pixel = new Color();

for (int x = 0; x < layer.Width; x++)
for (int y = 0; y < layer.Height; y++)
pixel = layer.GetPixel(x, y);
bitmap.SetPixel(x, y, Color.FromArgb(LayerOpacity, pixel));

return bitmap;

The PHP solution is slightly more easy:

$layers[] = imagecreatefromjpeg("images/example_background.jpg");
$layers[] = imagecreatefromgif("images/example_foreground.gif");
$layers[] = imagecreatefromgif("images/example_motto.gif");
for ($i = 0; $i < count($layers); $i++)
imagecopy($image, $layers[$i], 0, 0, 0, 0, 600, 550);
header('Content-type: image/jpeg');

We don't use the .PNG format when coding a .mobi website because not all handsets support this format. Similarly we cannot assume that Javascript will be supported and so we cannot rely on this as a solution. Everything must happen at the server and be sent in the most simple format to the mobile phone.

Further references


22 December 2009

Zabbix open source monitoring

ZABBIX (visit http://www.zabbix.com) is an open source distributed monitoring solution for enterprise level applications. It is capable of providing detailed networking information as well as polling servers to establish their health.

ZABBIX was created by Alexei Vladishev, and currently is actively developed and
supported by ZABBIX SIA.

It is possible to configure ZABBIX to email alerts to the administrator for just about any event. This means that even if you have several servers to watch you will be able to react quickly to any arising problem.

ZABBIX code is released under the GPL2 license ( General Public License 2 ). It is free to use and requires no licensing fees. The ZABBIX company offers both free and commercial support options.

My company currently has 8 production servers, three of which host mission critical applications and databases. It is possible for one of our operations staff to remotely login to each machine, check the status of the applications, do a trace on the database, check the logs... do you see how time consuming this can be? Of course we're also assuming that the operations staff is willing to do this 24/7!

Today I'll be implementing this open source solution. Lets see how it goes :)


I've now been using Zabbix for some time and have found it to be a generally positive experience. It does a good job of monitoring my servers, is fairly intuitive to set up, and has even landed our company a support contract. One thing that did bother me is that it insists on using a PHP function that the official PHP guide views as not being ready for production (see my later post here). I posted a question on the Zabbix forums and received no feedback from the community.

Oddly the most difficult part of getting Zabbix working was to reconfigure the rules on my firewall. I've inherited a messy set of rules, many of which apply to conditions that have ceased to exist within the company. Integrating new rules into this spaghetti requires concentration.

My next Zabbix challenge will be to implement the SMS send routines with a GSM modem. The documentation suggests that this should be easy as Zabbix natively supports SMS notification. Experience has shown me that very little promised in Linux documentation actually comes true. No doubt there will be a driver incompatibility, some software problem, or some other reason to make Zabbix misbehave.