Tired of Friction

This week has seen a couple of changes to my digital tools as I try to get back to basics, reducing the friction that gets in the way of productivity. macOS has been reinstalled on my personal notebook. Evernote has been re-installed and is receiving some documents to keep track of and index. The Lenovo X1 Carbon notebook, like the W541 upstairs, has been turned into a server. For the last couple of months there has just been too much friction involved with the day-to-day, and I've spent far too much of my time working around problems that shouldn't exist rather than focusing on the work in front of me.

The Workspace

So for the next little bit, I'm going to try this setup again. Closed software that I can generally trust to do the job its hired to do, with the cross-platform compatibility that I generally rely on to meet deadlines and deliver results.

If I later regret the decision, it will not take very long for me to restore the Lenovo notebook back to a development machine thanks to the backups that were made1.

  1. and tested. You do test your backups, don't you?

Why Use Linux?

Joey Sneddon over at OMG! Ubuntu! asked and answered the question of why someone would use LInux over Windows or macOS. His three-word answer leans a little close to zealotry, but is completely understandable. In my case, I've been 100% Linux on all of my computers for quite some time1 and rarely see the need to go back to either. While I can readily admit there are some applications that I miss from when I used to use macOS on a daily basis, going back to Apple's operating system is not something i'm prepared to do. Microsoft has made a lot of efforts to integrate Linux with Windows 10 but, even with the Linux subsystem functionality and Redmond's insistence that they love Linux, I cannot bring myself to allow any version of Windows to run bare metal on any of my machines. Like Joey, my reason can be boiled down to a three word answer: I trust Linux.

There are a lot of benefits of using Windows or macOS on a day to day basis. There's generally more commercial software available, faster driver updates, and better support for battery-related features. That said, I don't trust these systems. Same goes for Android. I simply do not feel it's in my best interest to put any data of value on a system that seems forever tethered to its creator, sending and receiving data as unobtrusively as possible in the background2. Linux distributions, as a rule, do not do this3.

Given the sort of data that I work with on a day to day basis and the trust people have put in me to not leak, lose, or share their data with anyone else, I need to completely trust my computers. Linux makes it easier for me to ensure that my systems are secure and non-communicative with unauthorized external resources.

There are undoubtedly a number of people who will disagree with me, and that's fine. While there are thousands of different distributions available to meet just about any need or criteria, the vast majority of people will be happiest on one of the two main commercial operating systems. This, too, is fine. It's not my job nor intention to convert anyone to Linux or provide the days or weeks of support that would be required while a person acclimated to the different system. Linux works for me. Specifically Ubuntu Linux. If someone reading this prefers something else, then it's better to continue using that software. At the end of the day, how we use our computers is a personal choice.

  1. This is despite the unenforceable expectation that everyone at the day job is using Windows 10 with the various tracking and "security" tools installed … including all the Apple devices.

  2. iOS also shares information back to Apple, albeit to a lesser degree. While I'm not keen on data leaving my possession without explicit permission, I generally know precisely what information is being sent to iCloud and can modify my behaviour enough to maintain some semblance of verifiable control.

  3. The online "outrage" that surrounded Canonical's attempt to collect system information after a successful installation was seriously disingenuous. While there is the option to send anonymous system data to Canonical, it was an opt in function that would show you the entire message so that you could determine whether it could be shared or not. After a little more than a year, it turns out that the majority of people installing Ubuntu Desktop send the data to Canonical

Who Will Use SQL Server on Linux?

This past weekend I was having a discussion on IRC with someone about the role of SQL Server on Linux, and who might actually use the database engine over many of the more traditional, open alternatives like PostreSQL and MySQL. The argument essentially boiled down to this: my opponent said that "nobody in their right mind who wants to use SQL Server would migrate from Windows to Linux", and I said that "SQL Server on Linux isn't for people who already have systems built to use SQL Server installations on Windows, but for people who haven't even started their projects yet". Both of us are likely correct to a certain degree, and both of us are likely over-generalising by using terms like "everyone", "most", and "developers".

I've been using Microsoft's SQL Server on an Ubuntu Server installation since it was first made available this past summer, and I've got to admit that it's a solid little engine. SQL Server has long been my favourite database, and I tend to use others primarily because my servers are all Linux-based. MySQL is the go-to, but does it have to be for smaller projects?

I don't think so.

So with this in mind, I plan on proving to my weekend opponent that SQL Server on Linux is a viable solution by migrating 10Centuries from MariaDB 10.1 to SQL Server 2017. This won't be a simple drop-in replacement, as the two systems do things differently enough that it makes zero sense to hammer a square peg into a round hole. Instead, I plan on taking the examining system and designing a proper replacement that'll play to SQL Server's strengths and finally move all of the data rules from the API layer to the database, where it actually makes sense.

10Centuries is very much a relational system, and it should be perfectly reliable on SQL Server Web despite all the licensing limitations that Microsoft has in place for that edition of the engine. If there's any change at all, it will likely be that 10C is faster after the database change. There will certainly be some performance reports after the fact. If I can drop API response time down by 500ms without spending a small fortune on more hardware (or software licenses), I'll be very, very happy.

Umm … Why?

A little over ten years ago I had an MCDBA certification from Microsoft that revolved around SQL Server 2005. Those skills are now well over a decade out of date, and I'd really like to get back into using this more powerful tool. By using SQL Server on Linux, I can gain experience with the system and also begin to understand the various things that the tool can and cannot do. I'm years away from becoming an expert, this should be a good first step down that road.

SQL Server can certainly be a great tool for people who prefer to use Linux and want to build or update their software. Just because it may not fit every use case doesn't mean it can't fill others.

Slackware 4.0

Basements have a typical feel to them that is hard to mask, regardless of how much money is spent with renovations. Moisture from the warm air upstairs condenses as it falls to give the area a cool, damp feeling. Many of my friends in high school lived in homes with basements that had become the de facto place for "the kids" to play and leave the parents alone. A friend of mine happened to have a computer1 and would spend endless hours in the basement on the Internet and chatting with people all over the world via IRC. I'd go to his place from time to time and we'd geek out over various things … typically tech specs and pushing his Intel 486 DX/2 66MHz processor as far as it could go.

One summer day we were on a school trip to Toronto to see … something. I don't remember what the school trip was about, but I remember that at one point we had 90 minutes of "free time" at the Toronto Eaton Centre2 for lunch. The University of Toronto is not too far from here, and my friend wanted to run to the book store there to get his hands on a 4 CD box set of something called Slackware. A new version had been released, and apparently it was the bees knees in terms of power and compatibility. We ran the whole way to the book store, found that the CD set was actually in stock, and ridiculously priced for the time. Just $14.99. Cheaper than the Robert Miles CD I had picked up earlier that day at Sam's3.

Because it was Thursday, he invited me to his house on the weekend where we planned to install the software on his computer. We were going to do something completely crazy, too. The partition would be split and resized, and a boot loader would be installed allowing people to choose whether they wanted Windows95 or this other operating system with the trendy hacker-like name.

Slackware. The very name was like something out of that early Angelina Jolie movie with all the unrealistic computer lingo. In the end, he couldn't wait. He got everything prepared and installed the operating system that night. I came over two days later and, because things weren't quite working out the way he had hoped, we killed the 150MB FAT16 partition4 and tried again to no avail. The problem we had was a common one at the time. One of the system components was just insufficient for the task at hand. In this case, it was running X-Windows without crashing out.

Computers back in the mid-1990s were incredibly underpowered by today's standards. The 486 that we were trying to install Slackware 4.0 on had 16MB RAM and a 420MB hard drive. The video card was a simple Vesa Local deal with an S3 chip and 512KB RAM. The 14.4 modem was, perhaps, one of the most expensive additions that had been installed and was a highly coveted device among the early tech enthusiast crowd as it was better priced than the stratospheric 28.8 and 33.6KB/sec modems, and could often be coaxed to run at 19.2KB/sec with the right software settings.

Geeky, right?

I can still remember with incredible clarity the hardware specifications of this friend's computer5, as well as all the things we did to eke out just a little bit more performance at every opportunity.

The ultimate problem, we thought, had to do with the system's lack of video RAM. On many of the Usenet boards we saw reports that people needed to have a video card with a whopping 1024K of RAM to use X-Windows reliably. The problem was that such cards could cost in excess of $100. Where would 14 year old high school kids get that kind of cash? Oddly enough, he found a way.

Somehow he managed to convince his mother that, in order for her to do some new task with an expensive financial package she bought, she would need to invest in a better video card for the machine. She conceded, and he was able to get his hands on a Matrox-branded video card with a brain-busting 4MB of RAM. The card cost several hundred dollars, and it was the card to end all video cards.

Armed with this new piece of hardware, he performed yet another clean installation of Slackware and went through the tedious process of configuring all of the settings files. We had reams of paper in a binder specifying what strings were required to initialize hardware, open a port, and activate one function or another. It was crazy. The following weekend I came over to see his handiwork and was stunned with the incredible clarity and speed of his unbranded computer. It was the fastest digital device I had ever seen, and the 14" CRT monitor absolutely sang at 800x600 and 16.7-million colours.

Slackware allowed for four virtual desktops, a feature that users of various Unix and Linux distributions have enjoyed for as long as I've known about Linux, and my friend would fly through the screens that would have different applications opened with different window settings. Everything was smooth and responsive. It was the greatest thing ever!

But it was not to last. The problem with Slackware, aside from it's lack of software and incredibly complicated configuration requirements, was that it required too much precious hard disk space. Once Windows95 started screaming about lack of space my friend was forced to scrub Linux from the hard drive and put things "back to normal". While he would occasionally dabble in Linux afterwards, he stuck pretty much to Windows from that point on until I moved to Vancouver in 2002.

We haven't spoken very often since then, and only through email, but I often think back to the times when he and I would stay up all night talking tech like a bunch of old hands who had worked in the field for decades. We didn't have the money to have the latest and greatest, but we had magazines and occasional access to the greatest resource that the world had yet to learn about: the Internet. I sometimes wonder what my life would have been like had he and I not geeked out and continually pushed the boundaries of what computer hardware was capable of back in the 1990s. It was a different time back then and, when I look around at the state of the technology community today, I sorely miss it.

MySQL Server at 100% CPU? Check Your Date.

Over the last few days I've noticed that a few of my servers have been using a solid 20% more CPU than normal, and it's something that I watch very closely to ensure my clients' websites are fast and responsive. This problem wasn't happening on the any of my web servers, though. Only the MySQL servers were under strain. What the heck could be causing this problem? Believe it or not, it was a fault of ntpd.

Here's a quick solution to the problem:

$ /etc/init.d/ntpd stop

$ date -s "date"

$ /etc/init.d/ntpd start

After doing this the MySQL server load dropped from an average of 0.44 to 0.12, and MySQL CPU consumption dropped from 95% to 4%. Much better! The problem seems to stem from the leap second that occurred last weekend. MySQL is not a fan of this extra second and would run into issues when working with date information. Sorts, diffs, and inserts were all affected by this issue.

This little problem is something I'll have to keep in mind the next time we go through a leap second.

Handling Leap Seconds

Yesterday was the longest day of the year and, as such, millions of computers around the world had to take into account the one extra second that was added to the end of the day. Many Unix-based operating systems have little trouble doing. Windows, however, got around the issue by updating it's internal clock after booting and checking in with the nearest time server. Good thing important systems don't run Microsoft software, right?

Seeing this line in my logs today brought a smile to my face, despite its lack of importance in my software:

Who knows. Perhaps one day Microsoft will stop treating concepts like time and non-English languages as secondary items and actually put the effort into making these things as seamless as they are in every other operating system currently in active development around the globe.