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.
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…
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:
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.
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.
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.
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.
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
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
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:
The default httpd-ssl.conf that comes on Windows as a template for setting up your SSL website has misleading examples in it that can lead to errors in your SSL Code. One of the errors that you may encounter while trying to use cURL to access the SSL site that you set up is:
error: 14077458: SSL routines: SSL23_GET_SERVER_HELLO: reason(1112)
Or some combination of those error codes. If you followed the syntax in the default httpd file verbatim then your ServerName and ServerAlias directives may have :443 on the end of them, such as:
Thank you to “paulsd” from this sourcefordge forum, this is related to an SNI warning thrown by your server because the hostname sent by cURL does not include the :443. You must have an exact match on a ServerName or ServerAlias in your vhost for the SSL site, so remove the :443 on the ServerName and ServerAlias.
This should get rid of the warning and allow cURL to function properly.
Today, North Carolina is voting on a Constitutional Ban of same-sex marriage and civil unions. While I am opposed to the amendment, my Facebook news feed has become quite cluttered lately full of other people’s opinions on the matter. I have created a chrome extension to make it easy to block these News Feed stories and easily unfriend the pesky poster…
Here is the Chrome extension that will block every post with the word “amendment” in it and allow you to easily unfriend the poster: