Thursday, December 14, 2017

Packet Pusher Priority Queue #135 Book Drawing

Hello, fellow network automation engineers! It has been a while since I last wrote about my blog, my apologies. Rest assured that I have not been slacking off, I have been busy working on another book project on Distributed Denial of Service (DDoS) with my good friend Rich Groves that should be out early next year. I am very excited about the project and hope it brings value to you if you are interested in learning more about the topic. 

Many of you have listened or at least aware of the episode on Packet Pusher Priority Queue #135 where I discussed my book and the subsequent offering of a free autographed copy if you sign up on this link a month after the airing of the show on November 9th, 2017. 

I am a few days late, but I have not forgotten about it. In total, there were 271 people who signed up (Thanks!). I exported the list into Excel sorted by the time they were signed up from: 

And I used the following Python script to randomly generate a number between 2 to 272 (since the first row is the header) 10 times: 

  1 #!/usr/bin/env python
  3 import random, time
  6 def rand_int(start_num, stop_num, num_range):
  7     for i in range(start_num, stop_num):
  8         number = random.randint(1, num_range)
  9         print("Run: " + str(i) + " Number: " + str(number))
 10         time.sleep(0.1)
 11         print("----")
 12     return number
 15 if __name__ == "__main__":
 16     result = rand_int(2, 11, 272)
 17     print("Congratulations to the person with Number: " + str(result))

The result was below: 

$ python
Run: 2 Number: 11
Run: 3 Number: 234
Run: 4 Number: 253
Run: 5 Number: 207
Run: 6 Number: 203
Run: 7 Number: 264
Run: 8 Number: 20
Run: 9 Number: 41
Run: 10 Number: 106
Congratulations to the person with Number: 106

I will notify the 106th person on the spreadsheet and arrange for shipping of the book. Thanks again for your support! I hope the blog and book have brought value to you. 

If you have a celebrated holiday at the end of the calendar year, I want to wish you happy holidays! If not, happy coding! 



Tuesday, November 7, 2017

Fun Alexa Skill for Mastering Python Networking

I recently created an Amazon Alexa Skill called "Mastering Python Networking Facts". It went live yesterday. You can check it out here: It will give you a fun fact about the book Mastering Python Networking (Packt Publishing, June 2017) that was published earlier in the year.

Although it is more fun to use this on an Alexa-enabled device, such as Echo Dot or Echo, You can test the skill, and any other skills, without such device. You can use:

1. Web-based EchoSim, Remember to sign in with the same Amazon account with the Skill enabled and allow the browser permission to use the microphone. Press the space bar to speak to the instruction and let go to hear the result.
2. Mobile App Reverb, Use the link on the page to choose the appropriate iOS or Android app. Remember to sign in with the same Amazon account.

After enabling, an example of the usage would be:
[User] Alexa, open Mastering Python Networking Facts.
[Alexa] The book has a total of 426 pages, more than 100 pages than originally estimated.  
It is a variation of the Alexa Skills Fact Template with two important differentiation:

1. The backend Lambda function is written in Python instead of Node.js. Only seems fitting that a skill on Python book should be written in Python, right?
2. The 'facts' were populated in DynamoDB table so the content is decoupled from the Skill itself.

In a later post, I will show you how to write the skill.

Leave me a comment of how you think the Skill can be improved.

Happy Python Hacking!


Wednesday, October 4, 2017

Mastering Python Networking Book Charity Donation Tracking

This is the place where I keep track of the charity donations from the royalty proceeds of my book, Mastering Python Networking (, by Packt Publishing.

Please note that I plan to donate 100% of the proceeds to charity, but would like to research the charity projects first before my donation so the proceeds might not be donated at the same time I received them.


June 2017

- SmileTrain (
- Tzu Chi Foundation (

August 2017

- Tzu Chi Foundation (
- Python Software Foundation (

September 2017

- Lake Washington Schools Foundation Pantry Pack (
- 21 US Virgin Island Relief Fund (
- Tzu Chi Foundation (

October 2017

- PyLadies (
- Tzu Chi Foundation (
- Python Seattle Chapter thru PSF
- Humble Bundle for PSF

November 2017

- Tzu Chi Foundation (
- Imagine1Day (

December 2017


January 2018


Thursday, July 6, 2017

Mastering Python Networking Book Q&A

It has been an incredible last few months for personal and professional growth in writing and publishing my first book, Mastering Python Networking ( Link), by Packt Publishing. Packt has a wonderful supporting team for the book, from content editing, copy editing, to graphic design. It has been a great book publishing learning experience for me.

For those who were curious about the experience, background story, and other aspects of the book, I have put together this list of Q&A's based on what people have asked me. I will add to the list when new questions arises.


Q. What is the motivation for the book? 

A. When I was writing about the book, I try to answer the question of, "If I am a network engineer trying to learn about automation and SDN, what would I need to know?" In other words, this is the book I wish I had a few years ago when I started down the network automation and SDN path. I hope to help others to avoid the mistakes I made and shorten the learning curve.

Q. How did you get the opportunity from Packt Publishing? 

A. This blog! I think the OpenFlow Tutorial entry along with some of the other work I have done for InternetworkExpert opened the door for me on this one.

Q. What is the book about? 

A. You can read the book description here. Basically it is about how to automate network tasks with Python packages.

Q. Where can I get the book? 

A. I am glad you asked! You can get the book here on Packt website or Amazon.

Q. Can I take a look at the book first before purchase? 

A. Sure! This book is part of the Packt subscription library that you can start a 30-day free trial for.

Q. Where can I get the code used in the book? 

A. You can get the code from the book page as well as the Packt GitHub repository.

Q. What are you doing with the money from the book? 

A. All royalties from the book will be donated to charity, although I have not decided where yet.

Q. Are you interested in writing more books? 

A. Absolutely! But I need to take a break first to recharge. :)

Tuesday, June 27, 2017

Scalable Text SMS System

I worked in a corporate telecommunication group for a while. I had a passion for Voice over IP (VoIP) technology, in fact, I had two US Patents that was filed and later on granted while with the technology. It is extremely difficult to build a scalable telecom network, especially dealing with local regulations, circuits, servers, hardwares and making all of them work together. Once you get the initial system up and running, you will need to repeat and rinse as you grow.

That is why it was so exciting to see a service like Twilio that simplified all the backends for you and reduce the service to API calls. With them doing the heavy lifting, you can now incorporate AWS API Gateway and Lambda to scale out your SMS Text notification service really easily. Check out my guest blog on the Twilio site:

As always, happy coding!

Tuesday, November 22, 2016

LittleBits Summer Event

If you have read my other blog post about LittleBits, you know I am pretty bullish about the kids-maker-movement. I do think LittleBits need more use cases and need to branch our and start making an effort to work with other devices instead of having a closed ecosystem. But kudos to them for developing a nice product that is very kids-friendly and easy to learn.

My 2015 Hackathon project at Microsoft actually had to do with LittleBits and Raspberry Pi 3 running Windows 10 Core, which won the 3rd place in the Teachers/Students/School category. That was actually the highlight of my summer that year. My goal, to whoever was willing to stop and listen at my booth, was to introduce this tool to the Microsoft Store and host kids summer camp to learn about electronics. To me, this is a great way to keep re-use the kits and benefit as much kids as possible without needing the parents to shell out an arm and a leg for LittleBits kits only to have the kids get bored after a week.

Which was why I was super excited to learn that Microsoft Store is now carrying the LittleBits kits at the store.

Maybe somebody was listening and this was the first step to carry out the idea I proposed? One can only hope... :)

Happy Coding!

Tuesday, November 15, 2016

Voice User Interface with Alexa - First Impression

It is so weird when a product works better in real life than from marketing hype. The last time I think this happened was with iPod and iPhone, it was simply something you have to get your hands on in order to appreciate the device. For me, my concern with iPod was the ease of user interface; with iPhone, how a small screen can conduct what a big screen used to do. Obviously both of the products were wildly successful and solved those two questions way ahead of me.

The biggest question on Alexa for me was this:

"Who needs a voice interface when we have virtual reality, Kinect, and a super computer that fits in your palm?" 

I thought it was going to another 10-inch Kindle that sounds ok but quickly goes away. But I think I was wrong about it. Here is the story behind it.

I am a fan of StraTechery, both the blog and Podcast. They were consistently bullish on Amazon, in particular Echo as a device and Alexa as a platform. So I thought, what the heck, I will give it a try. I was surprised at how easy it was to get started, how much Amazon has thrown its resources behind it. Even without a device, you can use EchoSim to simulate an voice controlled device and tied it to the back end.

As I read more about the use case, I think I am gradually beginning to think of it as a valid additional option. Here are what I think they do that is different:

1. You don't always have a phone with you at home, and Echo is precisely a home-based device.
2. It is hands-free, so you can operate it when you are busy with your hands and just want a quick answer. If you pay attention, you will be surprised how many times at home you just want a quick answer without pulling out your phone.
3. It is less tech than a phone. I stare at a computer screen most of the day and a phone screen the rest of the time. I treasure the time I can stay away from it while still getting the information I needed.

But even as I am turning from a non-believer into a curious party, the whole process of building my first app was still prove to be pretty difficult. In particular, I don't understand Amazon Lambda and that was suppose to be the 'easy' option to tie in the voice skill to AWS.

Stay tune for my next blog post about how I eventually was able to build my first "Hello World" app on Alexa.

ps. What does it have to do with Python and Network Engineering? Probably very little besides you can write network and Python-related apps down the line. But hay, all things starts with a little curiosity! :)

Happy Coding!