Connecting to Azure with FreeTDS (on a Mac even)

Connecting to an Azure database on your Mac can be more convenient than opening a virtual machine at times, especially when you’re working with a 128gb SSD and your Windows VM isn’t on said SSD. FreeTDS to the rescue!

While it would be nice if Microsoft would opensource the Microsoft SQL Server driver for Linux, FreeTDS seems to work for my situations just fine. In order to get FreeTDS installed and connecting to Azure, you’ll need Homebrew. After you get that sorted out, open up your favorite terminal emulator and run the following:

brew install --enable-msdblib --with-unixodbc freetds

Once this is completed and freetds is compiled, you’ll want to make some changes to your odbcinst.ini file possibly located at /usr/local/Cellar/unixodbc/2.3.2/etc/, but the best way to be certain about where your unixodbc installation assumes its files are is to run odbcinst -j from the terminal to check.

Once you have your odbcinst.ini opened in your favorite text editor, add the following:

Trace = No
TraceFile = /tmp/odbc.log

Driver = /usr/local/lib/
UsageCount = 1

If something goes awry, you can try debugging the situation with Trace = Yes later.

At this point, you have a driver installed named FreeTDS but no data sources configured. Go back to your text editor and open up the file ~/.odbc.ini or use the SYSTEM DATA SOURCES file that was given when you ran odbcinst -j. Add the following to the file you just opened:

Description = My MS SQL server on Azure
Driver = FreeTDS
Server =
Database = XXXXXXX
Port = 1433
TDS_Version = 7.2

Change the Server and Database options to match your own. Notice the TDS_VERSION, this option is key to connecting to Azure SQL Server instances since Azure doesn’t seem to accept connections for any protocol versions 7.0 or less.

At this point, you should be able to connect to your database via the isql tool:


If something isn’t working, make sure to enable the ODBC Tracing and check that log. Also, verify you’ve added your ip to the Allowed IP Addresses section under the Configure tab once you’ve selected your SQL Database Server in the Azure management portal.

PHP 5.6 x86 (nts) Windows SQLSRV and PDO_SQLSRV Extensions

UPDATE: check out Rob’s additions and compiled extensions here. They have added patches and he’s done an excellent job keeping up to date with them. I initially compiled because there weren’t any sqlsrv extensions compiled for PHP 5.6

I compiled some pdo_sqlsrv and sqlsrv extensions for php 5.6 because who the heck knows when Microsoft will do another official release.
The sqlsrv source code does need a small patch to successfully compile which usually puts a lot of people off when compiling things on their own so I figured I should make them available to the public.

Here’s sqlsrv.dll and pdo_sqlsrv.dll for Windows PHP 5.6 x86 NTS:


SQL Management Studio Jr.

It’s almost inarguable that Microsoft’s IntelliSense is either the top dog, or in the top three at syntax suggestion/completion. What bothers me is that with standard Visual Studio installs (as recent as VS 2013), you don’t get the full SQL Management Studio package. Instead you have to go download SQL Management Studio Jr., with a severely reduced feature set, from Microsoft. Why should you care?

How many developers of relational database-backed applications are there in 2014 that don’t have to think about database performance or troubleshooting ever?
I hope that answer is close to zero.
Even if you’re fortunate enough to have an experienced database administrator, as a developer it would be in everyone’s best interest if you tried to make their job easier and not harder.

As a developer that’s using Microsoft’s database platform, even if you’re not necessarily using Microsoft’s languages (Python, PHP, Ruby, and Node are all supported on Windows Servers), you should be able to do some simple query plan analysis, reporting, and troubleshooting. Yet, the tools required to do these simple tasks are mysteriously left out of the “free” version of Management Studio.

Have a query that’s running long for no apparent reason? Have fun; you’re on your own – unless of course you have access to a Microsoft SQL Server license key and supporting disk image.
In order to have access to the latest SQL Server Profiler, Integration Tools, and Database Engine Tuning Advisor, you’ll either need a better MSDN account (the MSDN account included with Visual Studio didn’t include SQL Server for me) or a full-on SQL Server license.


Luckily, my workplace has an MSDN account for us and I was able to use that. Had I been on my own, I would’ve been shelling out some serious dollars (SQL Server licensing is hilariously expensive) to have very basic tools that should be bundled with Visual Studio by default.

While some might view Visual Studio as the best IDE currently available, I still believe it has a ways to go in terms of developer friendly enhancements and decoupling from Microsoft as an avenue for revenue and instead using it as an incentive (reduced cost, free, etc.) to bring more developers to their platform. The full version of SQL Server Management Studio is a developer tool and should be included with every Visual Studio install.

Best new iOS game – Monument Valley

I normally don’t link to apps and games unless they’re relevant to an article, but Monument Valley is truly quite great and deserves it.

Monument Valley really is the perfect mobile game for me. I cannot recommend it highly enough for those that like fun puzzle games that are perfectly designed and suited for the mobile platform. It’s simple enough to play through a level or two in the time I have available, yet that sense of adventure is there so I never quite get bored and end up wishing I had more time to spend with it by the time I have to put my phone down.

To elaborate on “perfect mobile game,” I’m simply stating that many games are not designed to be played in short bursts of available free time that one might have while waiting for a cashier in the grocery store or for someone to arrive at a restaurant. Monument Valley is my new favorite game to fill these small voids in my life, so twitter will have to take the back seat once more.

Delivery, From The Internet

There are a lot of things that I dreamt up as a child:

I really liked drawing fantastical cars with my fancy colored pencils my mom would buy me.
I liked imagining what computers would be like.
All games would be virtual reality  and amazing (I was roughly five years old).

Once the internet came around and we had CompuServe (we had others but CompuServe made it more “real” to me as a child), I was certain that “everything” would be on and done through the internet. I was young and didn’t quite have a concept of the logistics involved in ordering a house on the internet and having it delivered – but I was certain these sort of things would take place soon.

When computer shopping around the year 2000, we ended up going with a Gateway, and when it was delivered (after ordering online) it felt like my imaginative dreams were finally coming true. It was amazing to me that a 50+ pound package could be delivered for for such a low price (I think delivery was $50-$99?). My mom and I were both very relieved to have not had to deal with the pressuring sales people at CompUSA, Best Buy, or Computer Builders Warehouse and we were further astounded that our custom computer was delivered within a month.

This week we’re getting our new bed delivered and it’s coming from somewhere near Topeka, Kansas…from “the internet”.

It’s an entire bed, and it weighs at least 100 lbs; delivery was free.
While a bed isn’t quite a house, it is just an odd moment that has triggered me to reflect on the progression of my own technology usage in my lifetime.

First Talk as a Speaker Submitted

I’ve never been particularly good at public speaking unless I am extremely passionate about the topic, or I’ve rehearsed my talk dozens of times. Even with rehearsal or passion, I’m not “good”, I just have less fear so I feel as if I’ve done a better job than if I was more fearful.

For me and my career, the most common venue for public speaking is during a meeting or presentation with a client. These client/customer meetings are generally easier for me due to my belief in my skills, abilities, or the product I’m effectively selling. Being able to stand behind and stake my reputation on something has been a terrific motivator and driving force behind where I’m at in my career today, but doing this as a speaker at a tech conference seems significantly more difficult. Most of the tech I have either passion for or belief in, or both (and that I would be qualified to speak about), are things I have not had any hand in creating. That lack of ownership made it difficult for me to justify to myself that I am even qualified to speak about or stand behind said tech. The other way I’d justify things is if I was bringing something new to the table about a topic, and previously all of the items I had wanted to talk about were already being covered in some way by pretty well-established speakers.

I finally overcame my own ridiculous self-doubt/mildly ridiculous justifications and submitted a talk entitled:

PHP misses you.

I’m 100% happy with this, regardless of the possibility of it being accepted or not.

The talk revolves around the idea that PHP has changed a lot and was spurred by a random conversation I had with someone about PHP at CodeMash 2014. I can’t recall the exact statement, but the person I was having the conversation with (honestly) posed a question that went something like:

“Oh, PHP – are they still doing releases of that?”

Yes, they are, and things are getting better finally. My potential talk would showcase lots of recent work that has gone on in PHP like closures, functional and object-oriented code, asynchronous, event-driven and non-blocking I/O, generators, iterators, and more neat things you can quickly use to get stuff done in PHP. It seems as though with this talk that I should be able to bring something new to the table for most attendees (though some pieces of my talk may be old hat to frequent PHP developers).

I realize I made the “mistake” of only submitting one talk. Most frequent speakers seem to acknowledge some sort of common knowledge that if you want to get accepted you should submit as many talks as you’re qualified for. I realize this is probably a more strict requirement for someone that they have to pay travel expenses for, but I live in the area of the conference I submitted my talk to so maybe my lack of multiple submissions will be overlooked.

I am excited and happy that I am taking steps forward to rectify some self-doubt and grow myself and my career further. I hope that this marks the beginning of another chapter in my life at the ending of which I’m amazed at the result and how I arrived.

When an employee or department falls for spyware pop-ups

Malware gets installed, computers get hosed, and hilarity ensues, but at what cost?

Everyone should take a really long, hard look at themselves and ask if their abilities are at the level the company requires them to be at. If not, do everything you can as an employee or organization to take a step forward. If, as an individual, you can’t take that step, you should probably find another job.

If as a company you can’t take that first step, you’ll likely be obsolete soon.

The best or nothing.™ – adopted elsewhere

My girlfriend and I talk about this on occasion, but for a moment, imagine if the motto “The best or nothing™,” was adopted by people or companies other than Mercedes Benz®. You can take this opportunity to imagine the ridiculous results of this – which is usually the path of discussion we take:

“How was your day today?”
“Well, I didn’t feel my best so I just did nothing at all.”

“We’ve been waiting four hours for our food, where the hell is it?”
“I’ve asked the chef numerous times, he simply keeps responding – The best, or nothing.”

And so on.

But for a moment, think about if this motto was adopted by people for things they’re truly passionate about. wouldn’t even need to exist.


THE BEST OR NOTHING™ and Mercedes Benz® are either registered trademarks or trademarks of DAIMLER AG and/or Mercedes-Benz USA in the United States and/or other countries.