Docker Performance Benchmark: Bare Metal, VirtualBox, and Hyper-V

The development world is quickly making the shift to Docker and microservices, and every day I feel like I’m running more Docker containers. My daily laptop is an Macbook Pro (Early 2015), but I’ve recently had the chance to test the Dell XPS 15 (9550) as well. In doing so, I got to wondering what the performance penalty for running containers through a Virtual Machine (such as Boot2Docker or Kitematic) as opposed to running on Bare Metal Linux.


Yii2 PHP 7 Performance

PHP 7.0.0 was just tagged yesterday, and I was interested to see if it could live up to the performance claims that Zend made. Yii2 is my PHP framework of choice, so I built PHP 7.0.0 from source, stress tested one of my application’s pages, and compared performance to PHP 5.6.4.

Benchmark Results

The maximum acceptable levels here for web performance are PHP 5.6.4 serving between 75-100 RPS at between a 31ms-176ms response time and PHP 7.0.0 serving 175 RPS at a 47ms response time.

PHP 7.0.0 does a very nice job here- about 2x the performance for serving Yii2! It seems that it is definitely worth upgrading.


Buzzfeed What State do you Actually Belong In Revealed

Buzzfeed recently released a quiz that has been getting a lot of attention on my Facebook news feed, titled “What State Do You Actually Belong In?“. The quiz consists of 12 sets of 12 questions and then produce an answer of a state that you supposedly closely identify with. According to Buzzfeeed, I belong in Minnesota, which is far too cold and obviously incorrect, so I decided to do some digging to figure out how their quiz system works.

buzzfeed-state-quiz

To view the states that Buzzfeed assigned to each quiz answer, view my What State Do You Actually Belong In Revealed (PDF). To see how I created this file, continue reading…


Yii Framework Active Record INSERT … ON DUPLICATE KEY UPDATE

Recently I was programming in the Yii Framework and ran into a situation where I wanted to use INSERT … ON DUPLICATE KEY UPDATE in an Active Record. In my research, I discovered that this is specific to MySQL. In my case, this was still be a valuable requirement for my Web Application and was worth extending Yii to get working. My approach was as follows:


Alpine UTE-42BT Review and Teardown

In the past few years, an interesting new option has arisen in the Music Industry – the option to purchase music “As A Service” is now extremely popular through services such as Spotify, Google Play Music, etc. I instantly fell in love with Google Play Music All Access and needed a way to play it in my car through my HTC One (M7) Android cell phone. I decided to upgrade my car stereo to the Alpine UTE-42BT Digital Media Receiver. Here’s my review after spending 2 months with the Alpine UTE-42BT.

Alpine UTE-42BT


JVC KD-X250BT Review

In my quest to bring my vehicle’s audio system up to 2013 standards, I started out with a search at crutchfield.com with the criteria of Bluetooth Playback and no CD Player. My specific use-case is playing Google Play Music All Access over Bluetooth through my HTC One (M7) to the Car Stereo. The search returned a few “Digital Media Receivers” (DMRs) and the first unit that I ordered was the JVC KD-X250BT. Here’s my review after spending a month with the JVC KD-X250BT.

JVC KD-X250BT


Aluminum Unibody MacBook Optical Drive Noisy, Buzzing, and Vibrating Fix

I have had my Late 2008 Aluminum Unibody MacBook for over 3.5 years now. I had not used my optical drive in quite some time, and went to watch a DVD today. The optical drive made a loud buzzing sound and seemed to vibrate more than usual. I opened the MacBook up and discovered that downward pressure on the optical drive made the problem worse, while wedging a screwdriver under the optical drive and applying pressure upwards made the noise disappear.

After the Aluminum Unibody MacBook’s introduction in Late 2008, Apple quickly changed the MacBook Pro lineup to the Aluminum Unibody design and all MacBook Pros from Mid 2009 through Mid 2012 have used a similar unibody design. This fix may also work for other MacBooks, MacBook Pros, or other Computers with slot-load Optical Drives. The fix does require disassembling the optical drive and will most likely void your warranty.

The fix is to disassemble the Optical Drive, bend the bottom aluminum cover of it outwards to relieve the pressure on the disc that causes the buzzing sound and vibration, and reassemble the Optical Drive. Here are pictures and instructions on how to do this:

Step 0. Open up your MacBook so that you can see all of the internals.

Step 1. Remove Connectors and Screws

Disconnect the Optical Drive connector and the Connector that covers the Optical Drive L-Bracket screw. Unscrew the speaker and the T-Shaped mount that covers the optical drive.


Dojo / Dojox Mobile mblDomButton Icon List for Android and iPhone Themes

The Dojo Mobile Android and iPhone themes contain default icons that can be used in widgets, such as dojox.mobile.ListItem and dojox.mobile.ToolBarButton widgets. These icons all start with the prefix “mblDomButton”. I could not find a detailed list of these icons, so I searched through the Android and iPhone CSS files to find everything with the mblDomButton prefix. I have an Android and iPhone page listing these icons and displaying them, both shown below.


Automatically Take EBS Snapshots and Delete Old Ones with PHP Script

I am a big fan of Amazon’s RDS product, which takes automated nightly snapshots of your RDS Storage and deletes old snapshots after a specified amount of time. After reading that Amazon’s EBS drives sustain a 0.1% – 0.5% Annual Failure Rate, I also wanted to take automated nightly snapshots of my EBS drives. Deleting snapshots after a certain number of days was also of interest, because this way I am not over-paying for snapshot storage at Amazon or removing snapshots manually. I also wanted to email the results to myself after backups were taken.

I did some searching on Google and found a nice script by Chris at Applied Trust Engineering, Inc. that runs PHP from the command line to create an automatic snapshot. I used this script as an example to setup my script, so thanks, Chris. My script has support for:

  • Backup Multiple EBS Volumes
  • Protect against script running again and creating another snapshot too soon
  • Delete Snapshots after a Specified Period of Time
  • Script outputs Detailed Snapshot Information for these 5 categories:
    • Snapshots that succeeded
    • Snapshots that failed and had errors
    • Old Snapshots that were removed
    • Old Snapshots that had errors while trying to remove
    • Snapshots that were preserved
  • Includes PHPMailer code to email results of script to yourself

Script Setup

You will need: (all links open in new window)

  • My ebs_backup.php Code (download is a zip) (or look below)
  • Stores snapshot information in “./snapshot_information.json” – Make sure PHP can write this file
  • Configure the lines of code within the configuration comment blocks
  • Run script periodically to your needs with CRON or whatever
  • Requires AWS PHP SDK be configured for your AWS Account: http://aws.amazon.com/sdkforphp/
  • Optional PHPMailer Support to email results to yourself: http://phpmailer.worxware.com/ (configure PHPMailer at the very bottom of the script)

Screenshot of Output

Automatic EBS Snapshots


Twitter Fails to Uphold the Social Media Contract

In 1651, Thomas Hobbes published his definition of the the Social Contract Theory in Leviathan. In short, Hobbes wrote that men in the State of Nature possess all freedoms, but that will lead to men fighting with each other and killing each other over land and food. Men give up a degree of their freedom to enter into a Social Contract with a government and in return get protection. Jean Jacques Rousseau and John Locke went a bit further and said that a government exists to support the popular sovereignty of the people, there was a couple Revolutions in late 1700s, and not longer the Declaration of Independence was signed. But that’s history, so let’s focus on the present…

If you apply this theory to Social Media, you get the Social Media Contract Theory, which is pretty much the same concept. If people were out on a free-for-all internet they would end up destroying their personal images on websites like MySpace. Therefore, they give up a degree of their freedom to join private social networking sites such as Facebook and Twitter and in return their account and personal information gets protected.

In Twitter’s case, I disagree. Twitter is downright failing to protect their users. In the past two evenings, I have received a Direct-Message from two separate people that I am following that contains a curiosity-inducing message followed by a shortened link through bit.ly:

This link takes you to a Phising site:

How the 2012 Twitter Direct Message Virus (phishing scam) Works

From what I have been able to gather about the 2012 Twitter Direct Message Virus, it is a Phishing scam that collects your username and password when you login to the fake-login page. From there, it stores your username and password. Within a short period of time, another script, either on a server run by the Virus owner, or more likely by a server hijacked by a different Virus, the Direct Message Virus automatically logs into your Twitter account. It sends all of your followers a Direct Message (see above) with a curiosity-inducing message body and then a link to the fake Twitter Page (also see above). If one of your followers falls for the phishing scam and enters their Twitter username and password on the fake site, the virus will start the whole process over with their account. What’s even more concerning is that many people use the same Username and Password combination on other websites, meaning those are now vulnerable to attacks as well.

In my opinion, Twitter has created an environment which has increased their users base’s likeliness for falling for Phishing attacks. Additionally, their Direct Message security is apparently non-existant. Here’s my opinion on the matter: