Docker and Vault: a preliminary tutorial

We most likely heard about Docker, the ultimate container. Recently I followed the GSG on the official website to get a feel for it. Vault is a open source project supported by Hashi Corp (famous for Vagrant, Consul, and other open source projects). I came across this docker vault image created by kintoandar (Joel Bastos) via his blog post Vault: PKI Made Easy. Since I was new to both technologies (I did followed the docker GSG on my Mac), Joel’s blog is a bit advanced for me, here are some of the steps I did to make the basic vault commands work.

I will update this blog post as I follow along the offical Vault GSG and Joel’s blog post.

docker pull kintoandar/hashicorp-vault
docker run -d -p 8300:8300 kintoandar/hashicorp-vault

docker help

Minjies-MacBook-Pro:sandbox minjiexu$ docker ps
c8b183b9e0ed kintoandar/hashicorp-vault "/bin/vault server -c" About an hour ago Up About an hour>8300/tcp admiring_jang

Minjies-MacBook-Pro:sandbox minjiexu$ docker logs c8b183b9e0ed

Minjies-MacBook-Pro:sandbox minjiexu$ docker inspect c8b183b9e0ed

Minjies-MacBook-Pro:sandbox minjiexu$ docker exec c8b183b9e0ed vault status -address
Sealed: false
Key Shares: 1
Key Threshold: 1
Unseal Progress: 0

High-Availability Enabled: false


(Update 11-19-2015) It appears Facebook started to spam me. It sent an email saying I got a new message, which is not true. It actually sent not just one, but two messages. Also this is the second week of my pager duty. This afternoon Gas Buddy sent me an alert, and it got to my Martian Notifier. The gas price went up at least 20 cents, useful notifications, but not timingly because I don’t want it confused with the real page (text message or SMS).

(Original 10-19-2015) Just survived first week of pager duty (on-call): two sleep deprived nights, and some tense times. On the first night, around 2 am in the morning, the phone rang (paging text message came). Good thing is after validation it seems nothing horrible happened. I tried to go back to sleep, but I could not. One thing I was worried is what if I slept through the page SMS (text message) from the phone. Made sure the ring volume is maximized. I did think about a smartwatch or a wristband (Fitbit like) before starting page duty. Was debating between Apple Watch (about $400) and Fitbit Surge (about $250). Note I already have Fitbit Charge, and I don’t want to have another addictive device like iPhone (Apple Watch), plus the cost associated with it. So I did a little google and found this Martian Notifier Watch. And I ordered it via Amazon immediately when I could not feel asleep. It arrived on Wednesday and I made it work quickly: basically I updated its firmware to the latest via MacBook.

Then I saw something interesting happened: it vibrates not only when a message arrives; but also when I started driving to work or drive my daughter to ice rink/COCA, and when I complete an Apple pay transaction. Of course I know the notification is from iPhone and I went ahead and turned them off yesterday. So today is basically quite because I handed off pager duty this morning, and I turned off the two main notifications on iPhone. The first one is interesting, because it will say how long it takes to work or some other places. So apparently Apple is collecting some information about my behavior (where I go for work, what’s my weekend routine look like). One can say iPhone get a bit smarter (artificial intelligence), or put it another way, Apple is getting sneaky with iOS 9.

Back to the main topic, how much notifications do I really want? I recall when I got my first Blackberry, and have gmail installed on it. I was still excited about the device and the red flash comes with a notification (e.g., a meeting is starting in 5 minutes). So I turned on the email notification. Quickly I found this is excessive, because it will flash very often. So I turned it off. Similar goes to the badge (phone, iOS) notification comes with the Slack app. Once I got distracted, when I got home, I paid attention to that Slack notification, and I left my one year old daughter in the car for a minute and two.

We are living in a post smartphone, smart watch/wrist band world. We increasingly pay attention to the notifications from those devices, while at the same time, potentially ignore other important notifications from real people, both at workplace and home. Attention span becomes shorter and shorter at workplace too, with the instant messaging and the “high importance” emails. On one hand they are notifications, on the other hand they are distractors. Ultimately it’s up to us to decide what is truly important. Get the spam call from telemarketer who notify us “you win a lottery” or “do you want a home security system”, or just turn off all the non-sense.

(Update 11-08-2015) Some friends suggested mi band (or mi 2 band), which is much cheaper (about $16), and it also has those notifications capability. I have not tried and am not sure about the reliability of those. I noticed on my Fitbit Charge, after a while (app or firmware update), and previously paired notifications between my Fire Phone and Charge needs to be re-done. In this sense I feel good about the Martian Notifier, because so far (3 weeks in) I haven’t seen a problem.

Martian Notifier smart watch

Also I looked a bit more into the iOS notifications. Note all the Martian notifier notifications are supported by the master device, in my case iPhone 6. I mentioned earlier iOS seems guessed my routines and intentions well both in weekdays and weekends. For example, we stopped by Starbucks at Olivette on Sunday afternoon when we done with ballet class at coca (u city). The Martian notifier aka iPhone will say 8 minutes to Olivette as soon as I start the car at coca. Similar for the ice skate classes on Saturday. I think I will leave it on on none pager duty days, because I don’t want it to be confused with work related pager. 

Read also About Notifications on iPhone, iPad, and iPod touch (by Apple)

Why Wal-Mart is losing to Amazon

Just look at this smart watch on Amazon. Can you believe one can get a smartwatch that basically has the functions of a $100+ pebble watch, and sell for $12.80 at Amazon? We know stuff at Wal-Mart are made in China. How about this watch? I bet it’s made in China too, not only that, maybe sold by a Chinese person (or company) too. This is amazing, thinking about the king of global logistics/trade Wal-Mart increasingly lose out to Amazon, for that matter, that person may bought this from Alibaba (Taobao) in China.

LEMFO Bluetooth Smart Watch

On a personal level, I felt I go to Wal-Mart less, because I have other alternatives, Aldi, Targets are good ones. Costco is a more expensive choice. I do sometimes shop at, and pick up at store. The free shipping is nice, but the wait at their counter to pick up things is not. Amazon got rid of that hassle.

Continue reading

Resources for aspiring software developers in St. Louis

We know St. Louis is not a hot (or cool) place as Seattle/Silicon Valley in terms of job opportunities for software engineers. But St. Louis area have plenty of opportunities from small to large organizations, with a diverse industries. There are also many resources for aspiring software developers who like to join the industry.

The No. 1 resource I recommend is LaunchCode. It was relatively new, but I personally knew 3 people got internship position through them, and 2 of them received full time offers, in last few years. They seemed really got the non-traditional students/newbies connected with the industry.

The No. 2 resource I like to mention is all these “user groups”, e.g., the old ones such as St. Louis Java User Group, St. Louis .Net User Group, St. Louis Unix User Group. They are mostly free and open to everyone, here is a list of monthly calendar compiled by the good folks at sluug. There are also some groups concentrate on newer technologies, such as iOS, Android, Angular JS Group, and functional and dynamic languages. Relate to the last one, there is also a conference on coding StrangeLoop which is considered good in the midwest (if not the US). I have been to most of the user group meetings and StrangeLoop conference (a while ago, when I’ve not got busy with 2 young kids), and I think they are good in terms of two aspects: 1) Learn new trends on the technology; 2) Get to know some of the people (they are not all nerds :-) Last but not least for user groups sometimes they have free food or door prizes: they are usually sponsored by the hosting companies or the recruiters who are looking for developers.

This is also my last bullet point. The recruiters. I know in this day of the age, we have a somewhat love/hate relationship with recruiters because they spam us on the phone, and on linkedIn. But looking at another way, for many openings esp. contractor positions are coming through recruiters. And also keep in mind not all recruiters are the same, there are some (if not a few) who are really good at finding positions and are also pleasant to work with. Not all are like car salesperson (for that matter, I think the perception on car salesperson is also rated unfairly). So my advice for aspiring developers is to establish something on LinkedIn, and start looking for a few good recruiters. I personally have worked with some very good recruiters, and my friend who found internship via LaunchCode worked with a recruiter at one time too (both out of necessity, sometimes companies can only hire contractor).

Will update this post as time goes.

tvOS tutorials collections

Note this is also available at github.

(10-06-2015 Update 2) Came across this one by tutsplus. Also the thoughts by Erica and savyapps.

(09-28-2015 Update) Came across this tutorial by madeupbypeople. Looks good. Also, note Xcode 7.1 beta 2 is coming out, along with iOS 9.0.1

(09-19-2015 Original) My Apple TV dev kit arrived. I haven’t done iOS dev for a while, not even get around the Apple Watch (I use a Fitbit Charge personally). But this new Apple TV thing seems really interesting, with all these TVML and TVJS things. There are not many tvOS tutorial right now, as this is really new and not many people get around it yet. But here are some I saw.

The following two both talked about TVML, TVJS and TVMLKit (the glue between TVML, JavaScript, and your native tvOS application per Kelvin Lau, see below). I know for traditional iOS developers Javascript may not be their favorite language (think Objective-C), but with the introduction of Swift, combined with the growth of popularity of Javascript in web development (both frontend and backend), we should at least pay attention to it. It’s much easier to setup a simple content navigation framework using Javascript and CSS (think websites) instead of Objective-C/Swift.

raywenderlich (Kelvin Lau @KelvinlauKL): Beginning tvOS Development with TVML Tutorial

Jameson Quave (@jquave)Developing tvOS Apps for Apple TV [Part 1] and Developing tvOS Apps for Apple TV [Part 2]

Mastering the tvOS Focus Engine: saw this at airbnb blog, this one is interesting because it talked about the focus and remote control. Note the game market is one focus of new Apple TV.

Quick Tip: How to use the remote control in your TVOS Apps for Apple TV in SWIFT

This one Hands-on with the tvOS SDK talked about porting iOS app to tvOS (note this is not a recommended approach). Nonetheless it’s interesting to see the gesture recognizer etc being discussed there.

I expect more tutorial and development on tvOS as we are close to the new Apple TV launch.

How to install Google Play Store on Amazon Fire Phone

One drawback of Fire Phone does not come with Google Play Store pre-installed. It comes with Amazon App Store instead, which has a much smaller collection. For instance, I could not find BoA app, wechat and all the Google apps there. Fortunately there is way to get around it, with the Google Play Store the Fire Phone becomes a middle range Android phone.

Make sure you do them in the right order: Account Manager, Services
Framework, Play Services, finally Play Store.
Account Manager:

Services Framework:

Play Services:

Play Store:

The first one you try to install (Account Manager) you’ll get a warning that it’s an unknown source and offer to take you to settings. Go to settings and enable App Installation (allows installations from other sources (read: Google Play))

Courtesy of qzmtl at mitbbs. This is the most simple instructions to install Play Store on Fire Phone. And I did it in 5 minutes or so.

Mobile Device Management

or MDM for the abbreviation. If you have read my blog for a while, you know I was a Blackberry fan, Blackberry was also my first Smartphone. The company (used to be Research In Motion) and the Blackberry has been in declining in recent years, and yesterday it announced buying the Good Technology (a rival mobile email technology provider). I have not used Good Technology based email myself, but have heard it being used in a few places I worked. Guess I was not important enough to carry a smartphone in those occasions :-)

Back to topic, Good Technology operates in a large space called Mobile Device Management, with a few competitors, MobileIron and AirWatch comes to mind for startups, then we have traditional players such as IBM and Citrix. I got to know MobileIron a few years ago as I was working on iOS dev and deployment and at the time, they have not IPOed yet. I looked at its stock price just now, and not surprisingly it did not do well. Just like Alex said in this Techcrunch article, it suggested this space is not gold mine. I knew AirWatch (which is bigger than MobileIron), was bought by VMWare in early 2014. If a company can go IPO, they would go IPO instead of being bought out. Of course this does not apply to Instagram and Whatsapp, as Facebook paid handsome money for them at the time. For Blackberry, it seems like a shrewd move as all these players are down at this moment, personally I felt MDM is a niche space that big player not necessarily want to crush startup, like Box or Dropbox situation (in that case, Google, Amazon, Microsoft Azure/OneDrive, and to less extent, Apple iCloud all compete). For BBRY, it seems like they just got some maintenance revenue to sustain for a while, while they try to turn around.

Don’t jail break the iPhone

Learned the lesson the hard way again. :-( :-)

I think nowadays jailbreak is not as popular as the early days of iPhone. And I did that also to my iPhone 3g, reason being I don’t want to stuck in contract with AT&T, so I jailbroke it and put in T-mobile prepaid card, and gave it to my wife. Now the consequence part.

Recently I want to sell this phone, as we no longer use it. We probably have not touched it for couple years. Since I gave my old iPhone 4 to my wife about 2 years ago. And I made a mistake put it in “factory unlock” category for this phone, which is not true. I found a buyer. But when I tried to remove the content of this phone, by going to settings, it got stuck. I had to put it in DFU mode by following this instruction. Also I had to upgrade it to iPhone 4.2.1, which is the last updated version of iPhone 3g. After that obviously I lost the jailbreak, as it does not take a T-Mobile SIM card to activate. Luckily I found a H2O (AT&T network) SIM card, and I was able to activate the phone. Note in the early days of iPhone, a SIM card is required to setup an iPhone. I was also be able to restore the content from iTunes backup after that, which is cool as I did not backup the contacts on the phone previously.

Long story short, I had to cancel the order, and put it on sale again in “AT&T” category, as this is no longer an unlocked iPhone. The morale of lesson here is jailbreak is not “factory unlock”, it consistently need to keep up once we update the phone, which is a hassle. Had I stayed with AT&T, I would get an unlocked code, and get it unlocked officially. Just like what I did with the old iPhone 4.

I thought about it more, since I paid the early termination fee, and I requested for device unlock via AT&T website. Did it couple times, and it worked. The first time it did not work due to my own mistake, they asked for email confirmation in which I need to confirm my email by clicking on the link. After the carrier unlock, I was able to restore the iPhone 3g to iOS 4.2.1 and use a T-mobile SIM card to activate the phone. Now I put it back in Apple iPhone 3G 8GB Black unlocked category on Amazon again.

iPhone backup photo extract and online photo backup

I learned the “iPhone photo backup lesson” the hard way a few years ago. At the time I was leaving the company (planned exit) and I need to turn in the company iPhone 4s, I did iTunes backup (encrypted, more on this later) on my PC, as well as on iCloud (paid $20 for 10gb extra space, the free one is 5gb). But where do I get the photos back? At the time I did not know there are software to extract photos out of the iTunes backup. So 6 months later, I bought a new iPhone 5s partly to get my photos back (restore the backup from iCloud to the new iPhone). Btw, this approach is a way described in this osxdaily article. A bit pricy option though.

Until today I need to restore some photos from an iPhone 3g backup, and I tried both the picturescue app (Mac only, $10), and the more pricy option of iPhone Backup Extractor ($30 for home, and $70 for Pro). The difference is the former only extract photos, the latter extracts contacts, SMS, etc. Also the Pro version works with the encrypted iTunes backup.

Online photo storage
My last tip is about online storage of photos. In the past I tried iCloud (paid), Dropbox (free), Google photo (15gb limit for free), Amazon (prime membership, for Fire Phone), and last but not least Microsoft OneDrive. I found OneDrive to be good as I got free space (115gb , among them 100gb is Bing bonus expires on 2/9/2017). So in other words Microsoft is consistent with Google on free space (15gb). I also used Google Photo (google drive) for backup on iPhone too (after returning 4s to employer). But on Google I have 17gb free space. Both Goolge and Microsoft offers $2 ($1.99) a month for 100gb extra space. So this comes at $24 a year. Better than Apple iCloud a few years ago. I don’t like iCloud because it’s not as intuitive as Goolge Photo or OneDrive. And I get to see/browse the photos online via desktop. I think I will stick with OneDrive for a while. One trivia on OneDrive, at one time I tried to back up Apple iPhotos files to OneDrive (about 35gb), it did not work out. One reason being the slow network speed. But I think there might be software related issues too.

One may ask why I resort to the iTunes backup for the photos, and why not directly get it out from the phone. Good question. In this particular case, the iPhone 3g w/ iOS 3.1.2 appears too old for Windows 7 and other OS to recognize as a digital camera. I tried 4, 5 computers (2 Macs and 3 PCs) to this phone and none worked. But the iTunes still works with the iPhone, that’s why I backed up the phone via iTunes and tried this route. So in a word, the photos jumped through the following hoop.

iPhone via iTunes back up => Mac picturescue => photos on Mac => USB stick => Windows PC => OneDrive

The USB stick part is optional, as OneDrive app exists on Mac. I did it because my Mac has smaller disk space than PC.