Canadians, did you know that you are probably paying a 2.5% fee whenever you make a US dollar transaction on your credit card? I knew, but I didn’t really think much of it. I just assumed it was a fee that I and everyone else had to pay. Well, apparently I was wrong. There are alternatives.

For those of you who have never heard of a foreign transaction fee, it’s a small fee that the credit card companies take when you convert a foreign currency (USD) to Canadian dollars. PC MasterCard’s fee is currently 2.5%. Other cards (like some American Express cards) are as high as 2.8%.

It may not seem like much, but it can add up over time and is especially noticeable on big USD purchases.

For example, suppose you are down in the US and charge a new TV to your credit card for $1000 USD. Let’s pretend the exchange rate is 1 USD = 1.10 CAD. So you’d expect your new TV to cost you $1100 CAD (1000 X 1.10) right? Wrong, we need to add the foreign transaction fee of 2.5% on top of the exchange. Suddenly your new TV now costs you $1125 CAD, an extra $25 in fees.

Up until a few months ago, I was regularly using my PC MasterCard to make my USD purchases. I usually spend about $80 per month on US based internet services, like AWS, Buffer, Google Storage, Pandora, etc. I also like to travel to Disney World as much as possible (which isn’t very often), and our last Disney trip cost approx. $2000 USD. So every month I’m spending about $2 CAD in foreign transaction fees and for my last Disney vacation I spent at least $50 CAD in fees.

How can I avoid paying these nasty foreign transaction fees?

There are actually a few credit cards that do not have foreign transaction fees. They are all Visa cards and they are all from JP Morgan Chase.

The one I chose was the Amazon.ca Visa card. Compared to my PC MasterCard, it seems a little archaic with its ancient online interface. And they still mail you a paper statement! Regardless of these minor annoyances, I didn’t take much convincing to drop my PC MasterCard for the chance to save probably at least $100 per year.

You can see the rest of the no foreign transaction fee cards here.

Have a look at your credit card statements and start counting up all those USD purchases to see how much those foreign transaction fees are eating into your wallet.

Disclaimer: I am not affiliated with Amazon Inc. nor do I benefit financially from recommending their Visa card.

I’ve played with a few of Vagrant’s support provisioners: Puppet, Chef and Ansible. They all are very powerful and have tons of options but of course with options comes complexity. It took me hours to learn each provisioner and get it to do what I wanted and I had to fight with each one at each step.

When I first started using Vagrant I simply dismissed the simple shell provisioner. What serious developer would use such a simple tool? Real developers use real provisioners.

Anyway, long story short, I spent less than 1 hour today with the shell provisioner and got it to do exactly what I wanted. I guess I like to pretend that my provisioning needs were a lot more complicated than they actually were.

Recently I was installing Couchbase Server on CentOS 6

rpm --install http://packages.couchbase.com/releases/2.1.1/couchbase-server-community_x86_64_2.1.1.rpm

I received this dependency error:

error: Failed dependencies:
libcrypto.so.6()(64bit) is needed by couchbase-server-2.1.1-764.x86_64
libssl.so.6()(64bit) is needed by couchbase-server-2.1.1-764.x86_64

To fix just install this:

yum install openssl098e

  1. Download ElasticSearch
    wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.6.tar.gz
    
    
  2. Extract archive
    tar -xzf elasticsearch-0.20.6.tar.gz
  3. Move extracted folder to /opt/elasticsearch
    mv elasticsearch-0.20.6 /opt/elasticsearch

  4. Set permissions
    chown -R root:root /opt/elasticsearch
  5. Change to elasticsearch directory
    cd /opt/elasticsearch

    // //

  6. Install Web GUI plugin
    bin/plugin -install mobz/elasticsearch-head
  7. Install Couchbase Transport plugin
    bin/plugin -install transport-couchbase -url http://packages.couchbase.com.s3.amazonaws.com/releases/elastic-search-adapter/1.0.0/elasticsearch-transport-couchbase-1.0.0.zip
  8. Setup a username and password for Couchbase Replication to connect to your ElasticSearch server. Change “abc123” to your desired password.
    echo "couchbase.password: abc123" >> config/elasticsearch.yml
    
     echo "couchbase.username: admin" >> config/elasticsearch.yml
    
     
  9. Edit ElasticSearch configuration file and set the following parameters
    cluster.name: NameOfYourCluster
    
    network.host: local ip address of this node
    
    node.name: "name of this node"
    
    
  10. Download a script that will allow you to run ElasticSearch as a service
    curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz
  11. We only need the one script so move it over
    mv *servicewrapper*/service bin/
  12. Cleanup
    rm -Rf *servicewrapper*
  13. Install ElasticSearch as service with the new script.
    bin/service/elasticsearch install
  14. Create a symbolic link
    ln -s `readlink -f bin/service/elasticsearch` /usr/local/bin/rcelasticsearch
  15. Start the service
    service elasticsearch start
  16. Make ElasticSearch start on boot
    chkconfig elasticsearch on
  17. Set the default template for Couchbase Transport
    curl -XPUT http://localhost:9200/_template/couchbase -d @plugins/transport-couchbase/couchbase_template.json
  18. That’s it. Your ElasticSearch server is now ready to be setup as a replication endpoint for Couchbase. For instructions on how to setup the replication on your Couchbase server visit: http://blog.couchbase.com/couchbase-and-full-text-search-couchbase-transport-elastic-search

This past weekend I was trying to use the Zend Framework Twitter library. While the documentation made it look simple, it was missing a lot of steps and information. With the help of a lot of googling I came up with this:

 
        $userToken = 'user_token';
        $userSecret = 'user_secret';
        
        $appConsumerKey = 'your_app_consumer_key';
        $appConsumerSecret = 'your_app_consumer_secret';
        
        // generate an Oauth token to pass to Zend_Service_Twitter
        $token = new Zend_Oauth_Token_Access();
        $token->setToken($userToken)
              ->setTokenSecret($userSecret);

        $options = array(
            'username'       => 'twitter_username',
            'accessToken'    => $token,
            'consumerKey'    => $appConsumerKey,
            'consumerSecret' => $appConsumerSecret
        );

        $twitter = new Zend_Service_Twitter($options);
        
        // verify user's credentials with Twitter
        var_export($twitter->account->verifyCredentials());