My personal blog as a programmer excluding point of view from my employer.
Don't wanna be here? Send us removal request.
Text
Home Automation
I picked smart home as a side project during holiday, just like all you guys!
Strategy:
Step 1: manage everything from our phones
Step 2: reduce manual touch by voice control
Scenario #1: Adjust indoor temperature automatically.
Device: Nest thermostat
This is the simplest way to getting started to make a smart home. Both myself and wife don’t remember last time we touch temperature adjustment. The Nest app provides great learning capability so that no manual scheduling required. Of course you can always adjust the schedule manually but I found that it’s totally unnecessary. Once it enables location based service, Home/Away mode can be automated as long as phones are online. The monthly gas bill showed smart thermostats do save energy, which is a key deliverable to prove their usefulness.
Fun story: It may provide tip every day to show whether the energy usage above/below weekly average and some times it blames human adjustment causes more energy usage. see my tweet.
Scenario #2: “Kitchen lights on/off”
Devices:
GE Link LED light bulbs ($14.93 from HomeDepot)
Wink Relay ($69 from HomeDepot) - serves as ZigBee Hub
GE zigbee in-wall smart switch
Amazon Echo Dot
The total implementation takes 3 times more than my estimate. I was thinking it’s pretty strategy forward after watching lots of guides from Youtube, but it ended up longer time on researching US lighting circuits. Lesson learn: know your home lighting circuits before buying any smart devices! I bought wink Relay first since I’ve seen posts from Reddit and other places told we can use Wink Relay (supports 2-way switch only) with 3-way light switch. However, the actual lighting circuit is more complex than what I thought: Almost every single celling lights are controlled by 3-way switches. Which means if using wink Relay, I have to bypass one of the paired 3-way switch. Which is a big show stopper since 1) it will change habit. 2) risk of changing light circuit. The reason I use Relay instead of any smart hub products is, I don’t need worry about introduing any hub which is a single point of failure. I can buy more Relays who will work with each other inside a mesh network. Plus it uses in-wall wire without any additional power adapter. BTW, the wink Relay is a piece of quality cool switch in-wall instead something you want to hide behind curtain.
Good resources: * wiki.winkathome.net/Main_Page * www.reddit.com/r/winkhub
To be continued. (more scenarios are coming!)
1 note
·
View note
Text
The easiest way to run Elasticsearch on OSX
The short answer is using docker if you have it already:
$ docker run -d -p 9200:9200 elasticsearch:2.1.1
Here’s a step by step guide.
Install Docker
It requires a docker client and a docker-machine.
Prerequisites
OSX 10.8+
VirtualBox 5.0.8+
If you’re using Homebrew, just run command:
$ brew install docker docker-machine
Or go through the full docker installation on OSX guide here: https://docs.docker.com/engine/installation/mac/
Verify it works:
$ docker version
Then it should show information about docker client.
Start docker daemon
You need a docker machine instance running locally first by these two commands:
$ docker-machine create -d virtualbox default $ eval $(docker-machine env default)
Verify it works again by command docker version and you should be able to see information about both client and server.
Getting Elasticsearch
Then just run the command:
$ docker run -d -p 9200:9200 elasticsearch:1.7.5
Now you should get an elasticsearch instance up and running at http://192.168.99.100:9200/
Q&A
Q: What if I want to install elasticsearch plugin?
A: find elasticsearch container id by command docker ps -a and install the plugin in elasticsearch container environment:
$ docker ps -a | grep elasticsearch $ docker exec -t <container-id> /usr/share/elasticsearch/bin/plugin install <plugin-name>
For example:
$ docker exec -t <container-id> /usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head
Thanks for @ReallyMacTroy’s fix for the command of plugin installation!
Update: use elasticsearch v2.x and the new plugin installation command.
1 note
·
View note
Text
Serving scoped npm packages on gemfury
It was a pain that resolving protected npm packages before the feature scoped packages. Now you can use this awesome feature with gemfury. If you don't know what scoped package is, follow this link to know what is.
Step 1: get a gemfury npm registry.
Register and create an account on gemfury.com, then go to gemfury dashboard and navigate to settings option to locate the API token. Then your personal npm registry URL will be
https://npm-proxy.fury.io/<your-api-token>/<your-account-name>/
Step2: upload your scoped package to your gemfury npm registry
create a npm project with a package.json file inside it. make sure the "name" attribute in package.json be like `@<your-account-name>/package-name`, then create project package:
$ npm pack
Then you can upload it by command:
$ curl -F package=@<your-package-name>-<version>.tgz https://push.fury.io/<your-api-token>
You should be able to see your package out of gemfury dashboard.
Step3: resolve scoped package
Now you can resolve this scoped package by using `@<your-account-name>/package-name` in package.json, then setup registry by command:
$ npm config set @<your-account-name>:registry https://npm-proxy.fury.io/<your-api-token>/<your-account-name>
Then enjoy command npm install.
2 notes
·
View notes
Text
Guide to upgrade HTC One XL to CM11 (android 4.4.4)
You can upgrade all required dependencies of CyanogenMod v11 on your evita (a.k.a. HTC One XL) in 20 minutes by following this guide.
First step, take deep breath and make sure you understand what "no warranty" means:
you may not distinguish your favorite HTC phone from a black brick.
I may not reply your comments left to this post.
Prepare
fully charge your phone battery
adb tools. I'm using a Mac so you can get it by running command `brew install android-platform-tools`
USB cable
make sure your phone is S-Off already (means no warranty from HTC)
read the information from http://wiki.cyanogenmod.org/w/Evita_Info
If you use the google authenticator app, I would suggest switching your 2-factor verification apps to send verification code to SMS/app. Or you will be stuck on signing your google account. Of course you can ignore this step if you shared nothing to google.
Firmware
Here's the guide: http://forum.xda-developers.com/showthread.php?t=2517148
I choose HBoot 2.18 which can be downloaded from: https://www.androidfilehost.com/?w=file-thanks&fid=23329332407572084&mid=70&download_id=40eeb6466b15355adcc264bda3f5ff39&tid=1410038616&hc=d022d62f72046ae61d2194b85819cab657cef04c4885e7cbbf03f94a161ed742
Recovery
It's very easy to upgrade your recovery if you get the HBoot v2.18. I choose TWRP 2.7.0.8 since TWRP 2.7.0.11+ doesn't work on my phone.
Download link: http://techerrata.com/file/twrp2/m7/openrecovery-twrp-2.7.1.0-m7.img
command:
$ fastboot flash recovery <downloaded-recovery.img>
ROM
Please download CM rom from http://download.cyanogenmod.org/?device=evita&type=
And optional google apps: http://wiki.cyanogenmod.org/w/Google_Apps#Downloads
While downloading these two zip files, you can reboot your phone to recovery after making sure you backed everything you need. The command:
$adb reboot recovery
you should get two zip files then run commands after your saw Team win recovery interface on your phone:
$ adb push <your-cm-rom.zip> /sdcard/cm11.zip
$ adb push <downloaded-gapps.zip> /sdcard/gapps.zip
Before flashing these two roms, you need to perform factory reset, cleanup Dalvik cache and app cache, it's recommended but not mandatory.
Then start flashing by touching "Install" then choose /sdcard/cm11.zip first, then /sdcard/gapps.zip.
Final step
reboot phone and perform the most difficult part, be patient about 5min.
0 notes
Photo
Hire a medium, and other ideas for How Not To Work Smart, courtesy of IBM for midsize business. Explore the gallery →
170 notes
·
View notes
Link
Subscribe to the feed: http://feeds.feedburner.com/UnderDevPodcast • Emoji’s in code. • Bill’s Yosemite beta, and no desktop virtualization love for Coté. • Bill is at Foo Camp - along with the...
The book "The new kingmakers" mentioned in this episode can be downloaded here: http://try.newrelic.com/rs/newrelic/images/The_New_Kingmakers.pdf
0 notes
Link
A couple of weeks ago, I was drinking beer in San Francisco with friends when someone quipped: “ "You have too many hipsters, you won’t scale like that. Hire some fat guys who know C++." ” It’s funny,...
0 notes
Link
If you develop something on OS X, you will like this post.
1 note
·
View note
Link
About this study | Pew Internet & American Life Project
Going to read this article carefully
0 notes
Text
Big Data is the new black

I absolutely love this quote: “Data is the new Oil. Data is just like crude. It’s valuable, but if unrefined it cannot really be used.” — Clive Humby (via IBM presentation).
Read More
59 notes
·
View notes
Link
Just followed this guide to flash my new HTC One XL successfully!
0 notes
Link
0 notes
Link
One of the questions we always get asked at meet-ups and conversations with other engineers is, whats your stack? We thought it would be fun to give a sense of all the systems that power Instagram,...
3 engineers. no time for self hosting.
0 notes