Moredigital Spam
Posted by Andrew McGrath in Uncategorized on May 10, 2012
If you ever get an email from “Moredigital” offering to place a text based ad on your site, you should first read this blog post:
http://travisweston.com/2011/11/19/my-experience-with-more-digital/
We were recently contacted, and after doing some reading around…it looks like the company is just out to create a very cheap ad distribution network. For the $100 / year they are offering, i suggest you just go ahead and install Google adsense, at least you’re getting it from a reputable source.
PAYPAL – AMEX- CANADA – GRRR!!!!!$@#@$$~!!!!!!
Posted by Andrew McGrath in Uncategorized on April 9, 2012
Universe, I need your help! Here’s my situation:
- I’m in Canada
- My customers want to pay with Amex cards
- Paypal seems to have it in for me
In Canada, when you try pay a merchant holding a “Paypal Website Payments Pro” account…they can only accept Visa and Mastercard. This is so frustrating.
What makes it worse? I went to Paypal for support, here’s what I get…

Paypal support...looks great!
Ok…lets just click one of those links…

what the?
ALL THE LINKS DO THIS! At least call the product “Website Payments fail” so i don’t get all excited next time.
Has anyone in the world managed to solve this problem?
Operations in The Cloud
Posted by Andrew McGrath in Startups, Things we use on March 25, 2012
Recently we launched www.verelo.com which aims to be your one stop shop for website monitoring. We started coding in August 2011 and launched in Jan 2012, since then we’ve obtained a small amount of funding and are pushing ahead full speed with features.
Today Verelo covers website monitoring focusing on providing notifications by Phone, SMS and Email, along with detailed reporting and sub-minute checks. In the near future we’ll be launching our 911 emergency response service (think of this as an outbound conference solution that will try get everyone onto a call at once, and if unsuccessful at getting the person to pickup, they will be emailed conference dial in details). We’ll also be adding cool services like log aggregation so you can actually get real data about “why” your site is down, not just a notification stating that “its down”. Exciting times, so stay tuned!
We would love to get your feedback, so if you have a website, API, online store front or even just a blog you want to have monitored bounce over to Verelo.com and signup for a free account!
Why I don’t care
Posted by Andrew McGrath in Uncategorized on March 24, 2012
Lots of people on Hacker News like to write articles about why they do things (Apparently 136,434) and while I’m getting a little sick of it…

I figure its time I get on board with the trend!!
I’m thinking of writing an article, either pick from one of my pre-selected topics or suggest your own by commenting. I promise to write it, get it polished and edited by a professional writer for your reading pleasure.
- Why I don’t punch people in the face
- Why I don’t drink from toilets
- Why I don’t own a horse
- Why I don’t light friends on fire
- Why I don’t jump out of windows
- Why I don’t walk around naked
- Why I don’t pee on strangers
- Why I don’t throw money at strangers with the intent of hurting them with large coins
Looking forward to your input.
Ever felt a little crazy?
Posted by Andrew McGrath in Uncategorized on February 13, 2012
Sometimes I feel a little crazy. Today is one of those days.
About 3 years ago now I moved from Australia to Canada. The reasons for the move were probably not that smart (A girl, not the one I’m with today…) and at the time I felt that I was giving up a lot of things which i had worked very hard to get. This all made me a little sour (“a little” might be an understatement). Today I’m flying to Mexico for 5 days, and then headed to California for another 6 where we’ll be staying with some of my partners family in LA, only to end the trip with some “business” in the Bay area which involves meeting up with some very talented people who I’m very lucky to be working with.
Why do I feel crazy? I feel crazy because before I moved to Canada I felt like things were looking good for me in Australia. I was running a small business, we were making a small profit and I we were getting well known for the work we did. I was 22. When I moved, all that went away and I took up a job for 50k / year as a Junior Project Manager and lived in a basement apartment. It was a pretty significant pay cut, not to mention loss of freedom. It felt like a huge step backwards.
When I look back at the last few years I realize there is no way in the world I could have ever got to where I am today if I had not moved. Don’t get me wrong living in Australia, the amazing education of TAFE (seriously, I’m not Joking…TAFE is great despite what some would say) and work I did while self employed prepared me for what I’m doing today, however Australia is pretty behind, compared to the opportunity in the IT industry that I’ve seen since I left.
Today I’m 25 back on the self employment path. In my last job I made the title of Director, something I thought I wouldn’t be able to do given my age (Truth is I do try hide my age a lot, its normally a surprise to people when they find it out). The big thing this promotion told me was that I would never be happy until I was back in the creators seat. Its not about money. So, i resigned and started up a company. Now I have a great business partner, a great product (Plug: Verelo website monitoring) that is only getting better every day, and more people interested in working with us than ever before. I’m back to enjoying the freedom of self employment but this time all the more aware of the discipline, from past experience, that it will take to keep things on track.
So again, why do I feel crazy? Simply because this is not what I expected. You turn one corner, look down the path and go “uh this looks bad” only to keep walking and find there is something worth looking for at the end. Whats the moral to the story? I guess you could say its “take risks” and “be persistent”. Risks that open up doors are always good, and if you don’t see something through to the end you’re wasting everyone’s time (including your own).
“The problem with the Internet startup craze isn’t that too many people are starting companies; it’s that too many people aren’t sticking with it.” Steve Jobs
Need to migrate your DNS?
Posted by Andrew McGrath in Uncategorized on November 4, 2011
This is a super short post but i just wanted to share it because i’m currently doing a DNS migration and finding that validating all CNAME and A records for our domain isnt super easy. Here is how i ended up doing it (You should re-use this PHP!):
//name servers to compare against
$nameservers = array();
array_push($nameservers,"ns1.origionalnameserver.com");
array_push($nameservers,"ns2.origionalnameserver.com");
array_push($nameservers,"ns1.destinationnameserver.com");
array_push($nameservers,"ns2.destinationnameserver.com");
//hosts to compare
$hosts = array(
"hostname1.com",
"hostname2.com",
"hostname3.com",
"hostname4.com"
);
//do the compare and echo out the results
foreach($hosts as $host)
{
//get the results for each name server given the current host
$results = array();
foreach($nameservers as $ns)
{
$result = getDNS($host,$ns);
array_push($results,strtolower($result));
//echo "LOG: $host $ns - $result\n";
}
//see if all the results match
$allmatch = true;
$compare_result = $results[0];
foreach($results as $result)
{
if($result != $compare_result)
$allmatch = false;
}
//check to see if everything matched or not
if(!$allmatch)
{
echo "WARN: $host does not match on all nameservers\n";
$count = 0;
foreach($results as $result)
{
echo "[".$nameservers[$count]."] $result\n";
++$count;
}
}
else
{
echo "INFO: $host OK\n";
}
}
//getdns function to get host name given a name server
function getDNS($host,$ns)
{
$string = '';
exec("dig @$ns +short $host 2>&1", $output, $retval);
if ($retval != 0)
{
return "ERROR_NO_RESULT";
}
else
{
$x=0;
while ($x < (sizeof($output)))
{
$string.= $output[$x];
$x++;
}
}
if (empty($string))
{
return "ERROR_NO_RESULT";
}
else if($string[strlen($string)-1] == '.')
{
$string = substr($string, 0, -1);
}
return $string;
}
Route53 – the good the bad and the great
Posted by Andrew McGrath in Uncategorized on October 20, 2011
So recently at work we’ve been looking to migrate a few services that are hosted on legacy infrastructure over to a much better set of servers at Amazon AWS. Along the way we hit a few issues, i wanted to share my experience with you so people never have to worry about these issues again…
Issue 1:
When using Amazon AWS Elastic Load balancers you get provided with a host name for the load balancer (not an IP – this is key). This is all good and well but DNS RFC 1034 states that the origin of a domain has to be a A record, but Amazon gave us a host name, so thats a CNAME? Our current DNS provider did not support host names as A records, so this isnt good.
Solution:
Use Route53 at Amazon. Amazon allows you to use their Route53 DNS service and create A records with an “AliasTarget”. These basically setup some crazy round robin DNS setup. There are a few steps to this:
1. Create the HostedZone using the Route53 API. Here is the XML required to create the hostedzone for my domain bitchasscode.com
<CreateHostedZoneRequest xmlns="https://route53.amazonaws.com/doc/2010-10-01/"> <Name>bitchasscode.com.</Name> <CallerReference>dns_migration_amcgrath_20111018</CallerReference> <HostedZoneConfig> <Comment>Migrate an existing domain to Route 53</Comment> </HostedZoneConfig> </CreateHostedZoneRequest>
2. Create the individual A records and Cnames for the domain using the Route53 API:
<?xml version="1.0" encoding="UTF-8"?> <ChangeResourceRecordSetsRequest xmlns="https://route53.amazonaws.com/doc/2011-05-05/"> <ChangeBatch> <Comment>Create record for bitchasscode.com.</Comment> <Changes> <Change> <Action>CREATE</Action> <ResourceRecordSet> <Name>www.bitchasscode.com.</Name> <Type>CNAME</Type> <TTL>300</TTL> <ResourceRecords> <ResourceRecord> <Value>bitchasscode.com<Value> </ResourceRecord> </ResourceRecords> </ResourceRecordSet> </Change><Change> <Action>CREATE</Action> <ResourceRecordSet> <Name>bitchasscode.com.</Name> <Type>A</Type> <AliasTarget> <HostedZoneId>YOUR LOAD BALANCERS HOSTED ZONE ID</HostedZoneId> <DNSName>DNS NAME OF THE LOAD BALANCER</DNSName> </AliasTarget> </ResourceRecordSet> </Change></Changes>
</ChangeBatch>
</ChangeResourceRecordSetsRequest>
This is a key step, becsause this is what lets you have a “hostname” as a A record. Sexy stuff…
3. Test your setup, it worked fine for me, however honestly its a real pain in the ass to do all of this. This created a new issue for me, i didnt really trust what I just did…so i started thinking about creating a UI for Route53 so i could easily view my edits.
Issue 2:
There is no UI for route53 provided by Amazon.
Solution:
Use Interstate53 as your UI, you just need to provide an AWS API key & secret…then you’re done!
Honestly i dont know a lot about Interstate53, other than its very amazing. I tried a few other services which didnt do the job for me:
- nsRoute (Doesnt do Alias records to ELB’s properly)
- dns30 (Doesnt do Alias records to ELB’s properly)
- easydns (They wanted me to signup, pay or something – too hard, i gave up after i couldnt work out how to get an account.)
Interstate53 were super easy to get going with (just provide an api key and secret), there is no registration or anything and their UI is great. It works perfectly with Alias records going to ELB’s and then you’re cooking!
I rotate weekly…and i like it!
Posted by Andrew McGrath in Things we use on October 15, 2011
Its time we all admitted that rotating our log files is something we should get our act together with and do properly. I was a bit surprised how relevant and simple examples were hard to find online the first time i had to do this, so i figured since i just had to install “logrotate” on my Ubuntu server again today that this is a good day to write about it.
Why is this important? Well if you don’t rotate your logs you will suffer from erosion. A massive problem for servers that don’t get a lot of love and attention…and honestly who wants to love a server? If you servers disk space is filling up with logs, and you are not emptying them faster than they fill up…thats erosion.
The following example tells you how to install logrotate and configure it to rotate your Apache2 log files.
Step 1.
Install logrotate on your server.
sudo apt-get install logrotate
Step 2.
Edit the logrotate config file to tell it where your apache logs are.
sudo vi /etc/logrotate.conf
Add the following to the very bottom of the file:
/var/log/apache2/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
/etc/init.d/apache2 restart > /dev/null
endscript
}
Thats great, but what does it mean?
Line by line, this is the breakdown:
1. /var/log/apache2/*.log
This is the path to the logs you want to rotate. I’ve said *.log here, because i want all logs in this directory to rotate
2. weekly
Tells log rotate to rotate these weekly
3. missingok
Prevents us from getting errors if there are no logs
4. rotate 52
How long should archived files be retained before being deleted
5. compress
duh…
6. delaycompress
Sometimes you dont want to compress the file right away, as the app is writing to the logs and will be for some period of time
7. notifempty
Only rotates logs that are not empy
8. create 640 root adm
This defines the file permissions that the archives will be created with
9. sharedscripts
Ensures any prescript or postscript elements of this log rotation are only run once
10-12. postrotate
This section defines what logrotate should do at the end of the rotation. In this case i’ve told it to restart apache, because we want to make sure new log files get created. Even although log rotate renamed the log file, apache will keep writing to the renamed file until its restarted (this is why we included the option ‘delaycompress’)
13. }
end of the log rotation config

ROTATE YOUR LOGS! SAVE YOUR DISK SPACES! OR I WILL HURT THIS RABBIT!
Fix your shit or i’ll take your customers money for you!?
Posted by Andrew McGrath in Uncategorized on October 7, 2011
Recently I’ve run into so many poorly setup systems, and what makes me sad is that people paid for them to do this. If you wrote any code recently and you’re trying to get people to pay for it, do them (and yourself) a credit by at least doing the following:
- GET A LOAD BALANCER
They are very simple to setup, services like Amazon AWS and Rackspace provide these for around $20 / month; they are not expensive. If you have your reputation on the line they are worth the spend! Even if you only have 1 machine behind the load balancer, if you dont use one from the start in order to introduce one later when things get serious you need to make a DNS change. This is a big issue because you probably want it to happen quickly. Add the load balancer in from the start! You can always add more servers behind it and with sticky sessions as an option, you dont even need to make code changes to your app! - DISABLE SSH ACCESS FROM THE ENTIRE WORLD
At Amazon this is very simple, create a custom security group and whitelist only the IP’s you want to have access via SSH. - DO NOT USE MYSQL WITH ROOT
Always create custom usernames for applications. Its nice to tell the difference between your app, and someone using the root account. - ALWAYS USE PASSWORDS WITH MYSQL
I came across a case yesterday where people were using root with no password - ONLY GIVE MYSQL ACCESS TO PEOPLE WHO NEED IT
Again back to the security groups, dont let anyone get access to your machine on port 3306! Only white-list servers which need access to your database. Sadly the same case i ran into yesterday using root and no password also had their instance open to the entire world. Major no no! - KNOW YOUR HOSTING PROVIDER
Companies like Amazon provide some amazing tools that if used properly can result in some great results. If you’re at Amazon try use things like RDS (Rather than installing MYSQL on an EC2 instance), take advantage of different availability zones (dont put every machine behind your load balancer in the same zone), know how to secure your site using tools like “Security Groups”, and understand how to enable monitoring. - Finally…MONITOR YOUR SERVICE
At Amazon CloudWatch is your friend, use it! Its cheap ($3/month) and very useful…if you want to get an email when the number of unhealthy servers in a load balanced group increases, this service can tell you! Tie that baby in with companies like PagerDuty and hey presto, every time a server goes out of service you get a phone call.
If you use the tools you are provided with properly, your life is easy. If you dont someone like me will jump on your machine, drop your database, sit back and laugh because you’re not monitoring it and you dont have a clue it happened until the customer calls to yell at you.
Fix your shit, or i’ll take your customers money and keep it for myself!
A new day, a new office!
Posted by Andrew McGrath in Funny, Things we use on October 4, 2011
We decided that we’ve been far too well behaved this year. We’ve saved up some decent capital, worked hard, built up a bunch of new customers and now its time to reward ourselves! What better way to do this than by getting a flashy new office (and by flashy i mean, slightly dusty…)
Meet our new 27.5ft boat office.
