tag:blogger.com,1999:blog-9097469128559225472024-03-18T12:46:59.042-07:00Network Automation NerdsTools for the Network Warriors (formerly Python for Network Engineers)Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.comBlogger102125tag:blogger.com,1999:blog-909746912855922547.post-8557997306270910642020-05-26T09:27:00.003-07:002020-05-26T09:30:40.915-07:00New Blog on "Motivation Alone is Not Enough" Hi Network Automation Nerds, <div><br /></div><div>The Memorial Day long weekend (in the US) gave me an opportunity to reflect on some of the projects I have worked on. Mainly I wanted to focus on what made the projects work, and if it did not work out, what happened? </div><div><br /></div><div>The two main takeaways from my own reflections are: </div><div><br /></div><div>1. I almost <b>ALWAYS</b> started with high motivation for each project. </div><div>2. <b>The projects that work did not depend on motivation alone</b>. </div><div><br /></div><div>If you are interested, read on to see what actually helped me. This includes me taking a trip down the memory lane of my first all-hands meeting at Amazon: </div><div><br /></div><div><a href="https://networkautomation.ninja/p/blog/motivation-alone-not-enough/" target="_blank">https://networkautomation.ninja/p/blog/motivation-alone-not-enough/</a></div><div><br /></div><div>I hope it can help you in your own projects. Leave me a comment on what you think! </div><div><br /></div><div>Best wishes, </div><div><br /></div><div>Eric</div><div><a href="https://networkautomation.ninja/">https://networkautomation.ninja/</a></div><div><br /></div><div><br /></div><div><br /></div>Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com20tag:blogger.com,1999:blog-909746912855922547.post-3806284785237631052020-05-19T09:32:00.000-07:002020-05-19T09:32:48.593-07:00Announcing the Launch of NetworkAutomaiton.NinjaHi Network Automation Nerds, <div><br /></div><div>First, I hope we are all staying healthy and safe. This is not normal times and I sincerely hope we are all coping with to the best of our abilities. Of course, special thanks to the healthcare professionals and essential workers during the COVID-19 pandemic. </div><div><div><br /></div><div>Second, has it really been two years since I wrote my last post here? Wow, time really flies. Of course, I still enjoy writing and creating, as evident by the publication of the third edition of '<a href="https://amzn.to/37xFpuw" target="_blank">Mastering Python Networking</a>' and many other guest blogs across many other sites. <div><br /></div><div>So why have I not been writing on this blog? Mainly because I hate the outdated style and the lack of control on the Blogger site. I mean, the site looks ok, the publishing tools are ok, and if you hack it the right way you can make it look acceptable. After all, I have been doing this for many years. But that is precisely the problem, the longer I have been writing using the default Blogger tool, the more unsatisfied I became. </div><div><br /></div><div>I also want more engagements from the readers, the readers deserves to have a better interface and deeper engagement. There are also contents that I feel more comfortable behind a registration wall. </div><div><br /></div><div>Well, today I am very happy to announce the launch of my site <a href="https://networkautomation.ninja/"><font color="#f4a900">https://networkautomation.ninja/</font></a>: </div><div><br /></div><div><br /></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://networkautomation.ninja/" style="margin-left: auto; margin-right: auto;" target="_blank"><img alt="https://networkautomation.ninja/" border="0" data-original-height="800" data-original-width="1471" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA4FH82lZVzAWNoVxDOJ2G29wd-DJowxhmAOSfwdfMvhYfB20TZZtby49D8lzqkTls-PsRtG6BZIdQAz_0MvtmirPDlRm7DbTUlXJKE-JLLbXkEgAwZmt1EEqP0UX4K-YCak8-2GyqsD8/w400-h217/Screen+Shot+2020-05-18+at+6.47.14+PM.png" title="https://networkautomation.ninja/" width="400" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><a href="https://networkautomation.ninja/">https://networkautomation.ninja/</a></td></tr></tbody></table><div><br /></div><div><br /></div><div>I also prepared a little FAQ on the purpose of the site and some other things that I think might be interesting to the readers, <a href="https://networkautomation.ninja/p/site-links/faq/">https://networkautomation.ninja/p/site-links/faq/</a>. </div><div><br /></div><div><br /></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><span style="margin-left: auto; margin-right: auto;"><a href="https://networkautomation.ninja/p/site-links/faq/" target="_blank"><img alt="https://networkautomation.ninja/p/site-links/faq/" border="0" data-original-height="792" data-original-width="1452" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS4n2AUjZgG2TqK-9rIp4fSauwbvYRx2_Vz3IEemTp7LuoWIOrt5wtK_HYCQHZ4M0DOEMkrqzdp7oiSd7ZJQxA4WoCP9F4Do7VNNAQ3zI6DhpVvvatbvGByKXj_bLBi6Z2MbJzq-uqz6s/w400-h219/Screen+Shot+2020-05-18+at+6.51.15+PM.png" title="https://networkautomation.ninja/p/site-links/faq/" width="400" /></a></span></td></tr><tr><td class="tr-caption" style="text-align: center;"><a href="https://networkautomation.ninja/p/site-links/faq/" target="_blank"></a><a href="https://networkautomation.ninja/p/site-links/faq/">https://networkautomation.ninja/p/site-links/faq/</a></td></tr></tbody></table><br /><div><br /></div><div>Feel free to poke around and let me know what you think. This is the first step of what I would hope to be many more to come. Make sure to sign up for the newsletter if you have not done so on this blog site, <a href="https://networkautomation.ninja/newsletter/">https://networkautomation.ninja/newsletter/</a>. </div><div><br /></div><div>If you'd like, you can also register for the site and take a look at the membership area, there is not much there now but certainly more to come! </div><div><br /></div><div>I would like to thank you for your time and support, I always appreciate an honest feedback. Let me know what you think of the new site. </div><div><br /></div><div>Happy coding! </div><div><br /></div><div>Eric</div><div><br /></div><div><br /></div><div><br /></div><div><br /></div></div></div>Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com2tag:blogger.com,1999:blog-909746912855922547.post-60678729172764241062018-01-22T09:27:00.001-08:002018-01-22T09:27:10.241-08:00Network Automation Nerds ShoesHi Network Automation Nerds, yep, you read that title right, I am writing about shoes in this blog post. For the impatient, just click <a href="https://www.aliveshoes.com/network-automation">here</a> on AliveShoes.com to see the pair for yourself. (Full disclosure: I get $15 royalty from every shoe purchase, which I am happy to donate to a charity).<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVYw8c-nUvQMX-V0N9Ma76lH45lOln9gTPN_m1P5yEQlqN10_wkr42cxyhpKUAjftx4emLFrVeGJ1MN2JjGfeELhaFskrFwfjM0DnJvlWsEtAOpjeGS9gT7DbkTtE-zaJutdmO3Z6B-84/s1600/Screen+Shot+2018-01-22+at+9.10.20+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="548" data-original-width="666" height="263" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVYw8c-nUvQMX-V0N9Ma76lH45lOln9gTPN_m1P5yEQlqN10_wkr42cxyhpKUAjftx4emLFrVeGJ1MN2JjGfeELhaFskrFwfjM0DnJvlWsEtAOpjeGS9gT7DbkTtE-zaJutdmO3Z6B-84/s320/Screen+Shot+2018-01-22+at+9.10.20+AM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiInZy05tTaAXFC-K9qVJe-VGXfKVDzJp41rxd1_KH-uDiiUi6RomjDt5IRVVmZ3PV_fNGbVeieC-k6z91c-mB03oWmw6VPDcpLyp2zsJ1Ewl_gVujFlZiAUZBoW3QcWrdUFj8gwi0nM7M/s1600/Screen+Shot+2018-01-22+at+9.10.40+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="405" data-original-width="691" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiInZy05tTaAXFC-K9qVJe-VGXfKVDzJp41rxd1_KH-uDiiUi6RomjDt5IRVVmZ3PV_fNGbVeieC-k6z91c-mB03oWmw6VPDcpLyp2zsJ1Ewl_gVujFlZiAUZBoW3QcWrdUFj8gwi0nM7M/s320/Screen+Shot+2018-01-22+at+9.10.40+AM.png" width="320" /></a> </div>
<br />
<br />
"Why?" well, let me tell you:<br />
<br />
<ul>
<li>I am kind of a sneaker head. Here is the <a href="https://www.urbandictionary.com/define.php?term=sneakerhead">Urban Dictionary</a> of what a sneaker head is. I don't believe I am a die-hard shoe collector (my wife might disagree), but I do like them. I have about 13 pairs of retro Jordan shoes up to Jordan 14 (his last championship year with the Chicago Bulls). Growing up not able to afford them in the 90's gave me kind of a weak spot when I spot the retro shoes. Being blessed with working in the high tech industry where we can wear whatever we want to work, the Jordan's has been my "work" shoes for the last 17 years. </li>
<li>It is kind of fun to see your logo on a physical product. That is why people like to customize so much and T-Shirt swags are prevalent at almost every single start-up's out there. Shoes are about 13x more expensive than a T-Shirt to buy, but hay they are about 20x more durable. At least I hope they last 20x longer anyways. </li>
<li>Prepare and practice for future events. If my company ever goes IPO, one can certainly hope, I already know how to make a pair of IPO-bound shoes for the event! Or at the very least, I can wear this pair at Meet Up's and be a conversation starter. </li>
</ul>
<div>
I can't wait to see them in person (15-20 wordays and ship from Italy). </div>
<div>
<br /></div>
<div>
Eric</div>
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com26tag:blogger.com,1999:blog-909746912855922547.post-63544868596149250662017-12-26T09:37:00.003-08:002017-12-27T10:29:23.023-08:00Getting a [Late] Report Card for My BookHi Nework Automation Nerds, happy holidays! As we are close to the end of 2017, it is literally the last Tuesday of the year as I am writing this post, I thought it would be a good idea to look back at the biggest project I took on in the year, writing a technical book <a href="http://bit.ly/echou-book-amazon">Mastering Python Networking</a>.<br />
<br />
By now, you might be tired of hearing about me talking about the book. I dont blame you, I know I am a bit tired writing about them. The process was such a big part of my year there was no way to separate one from the other and whenever somebody asks me "Eric, what are you up to?", the subject of book writing inevitably come up. So I ended up talking / thinking / promoting / reflecting about the book for most of 2017.<br />
<br />
I will always look back at 2017 fontly as the year I became a published author, but saved for some occational update and reflections, this is probably one of the last post I will write about the book. I will continue to update the <a href="http://blog.pythonicneteng.com/2017/07/mastering-python-networking-book-q.html">Book Q&A Post</a> and <a href="http://blog.pythonicneteng.com/2017/10/mastering-python-networking-book.html">Donation Tracking</a> as new updates become available but they will be contained to the parameters of the two posts.<br />
<br />
Don't get me wrong, I am super proud of the work and treasure the work I put in, but I am ready to move on.<br />
<br />
There are plenty of posts about author's experiences of writing techincal books, two of the more interesting ones are <a href="https://www.xaprb.com/blog/2008/06/15/what-is-it-like-to-write-a-technical-book/">here</a> and <a href="http://jessefreeman.com/articles/10-lessons-i-learned-after-writing-my-first-tech-book/">here</a>. I have my own experience, of course, but I don't feel like I am ready to write about it just yet, particularly because I am still wrapping up with my second writing project with O'Reilly that is due out in Febuary 2018.<br />
<br />
So what would be an interesting subject about the book to sum up the experience for 2017? How about let's take a look at how many copies the book has sold so far? I know I would be interested in knowing the post-proudction process if I were a reader of the blog.<br />
<br />
As fate would have it, I received my Q3 2017 report the Friday before Christmas:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr9bHhVFPRuvOgoPFobW_nkGLX3xIx3H4Onk1lulXYzBYUzZfnD1v4_f9UUl25YI2TQMxjYaFsrwxdh7fYwP_nCbmuQvhTYB7CjOH2bPd5OGnZX6DrOpxnU8yqlL0JRRl47wT2HrTU1ZA/s1600/Screen+Shot+2017-12-26+at+8.41.31+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="898" data-original-width="793" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgr9bHhVFPRuvOgoPFobW_nkGLX3xIx3H4Onk1lulXYzBYUzZfnD1v4_f9UUl25YI2TQMxjYaFsrwxdh7fYwP_nCbmuQvhTYB7CjOH2bPd5OGnZX6DrOpxnU8yqlL0JRRl47wT2HrTU1ZA/s320/Screen+Shot+2017-12-26+at+8.41.31+AM.png" width="282" /></a></div>
<br />
A few things that stood out for me:<br />
<br />
<b>1. It is kind of late. </b><br />
<br />
Noticed that on December 22, 2017 I just received the royalty report from July to September 2017. Essentially the report took 1 whole quarter to generate. If you have read some of the other post by authors, you know this is normal. But it still struct me as odd that it took so long to produce a report. Perhaps this is just Packt Publishing, but I doubt it.<br />
<br />
<b>2. More eBooks than Print books were sold, more than 3:1 ratio.</b><br />
<br />
I guess this does not come with a surprise that at a 3+:1 ratio people were preferring ebooks than their printed counter parts. The royalty on ebooks is about 1/3 of the printed book, so on the money front the printed book is more lucrative. But I can certainly understand the prefence.<br />
<br />
For me, I know most of my technical books are not only in digital form, a large chunk were in subscription services, such as Safaribooks Online.<br />
<br />
<b>3. It exceeded my personal expectations for units sold. </b><br />
<br />
My wife can back me up on this. When I initially sign on to write the book in January 2017, I told my wife that I think it would be awesome if the book can sell more than 100 copies. In fact, when Packt reached out, I emailed them back and ask them to confirm because I thought the market was so small. I mean, in my mind network engineers are a pretty narrow set of folks compare to systems engineers and developers. If you take that number and estimated that 10% of them will be interested in the book, then you arrive at a pretty small number. Truth be told, I was a bit worried that Packt will loss money for giving me a chance despite my best effor in writing the book.<br />
<br />
However, I am pleasantly surprised at the number that it posted in the first three months of the book's existence. 101 print copies, 101 subscriptions, and 375 ebooks is small compare to Harry Potter or Hunger Games, but it is good enough for me. Not to mention it is being translated to Korean by Packt's Korean publishing partner, Acorn Pub. :)<br />
<br />
<b>4. I still have not earned out my royalty advancements.</b><br />
<br />
Sadly, even with the number it posted I still have not earned out my royalty advancements. To clarify, Packt gave me a set amount of money for completing the book, but they count toward future royalty payments. It is somewhat of a bet on the publisher's part, as if the book sells for less than they anticipated, they would loss money on the deal. On the other hand, if the book sells well, they will recoup their cost plus more. For the author, well, let's not talk about the money vs. the time they spent on writing the book because it is depressing... :)<br />
<br />
Well, that was my quick update on the book. Happy 2017 and look forward to a productive 2018!<br />
<br />
Eric<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com0tag:blogger.com,1999:blog-909746912855922547.post-43001782743932020912017-12-18T09:40:00.002-08:002017-12-20T16:25:28.541-08:00Ansible 2.5 on the Horizon Greetings Network Automation Nerds!<br />
<br />
Just attended the Ansible 2.5 webcast for Network Partners. It seems to me that the changes in 2.4 were more behind the scenes, i.e. persistent SSH connections, while Ansible 2.5 will have more visible changes for network engineers who are writing Playbooks.<br />
<br />
<a href="https://www.ansible.com/networking-partner-webinars">Ansible Networking Partner Webinar (December 18, 2017) Recording</a><br />
<a href="https://docs.ansible.com/ansible/devel/porting_guide_2.5.html">Ansible 2.5 Porting Guide</a><br />
<a href="https://github.com/ansible/community/wiki/Network%3ACore-roadmap-2.5">Network Core Roadmap for 2.5</a><br />
<br />
<br />
Here are a few of the takeaways for me, all welcome changes:<br />
<br />
<ul>
<li>Network automation continues to be more similar to other modules. For example, instead of specifying connection as local and use the provider method for network cli connections, in 2.5, you can specify network_cli or netconf as the connection. This allows the two connection methods to be used directly in shell. </li>
<li>More emphasis on Testing for network modules. "If it is not tested, it is broken", right? </li>
<li>More community building, such as <a href="https://github.com/network-automation">https://github.com/network-automation</a>. </li>
</ul>
<br />
<br />
Here are some of the screenshots from the webcast on the connection method, testing, and community:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLBaMKnMpwWxqk_zy0TRj6P98C05qC7WO17fGi_rn7IakIeNmXDswEYhoVR8vSVG2QNSMkMnJSGOiQZ2FlIs3UUiOgOutHTyAg5KPZx_Yja_dtjsc-uiVHwFdXnYxtCJgPP5dr-18Lt4k/s1600/Screen+Shot+2017-12-18+at+8.11.40+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="705" data-original-width="1285" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLBaMKnMpwWxqk_zy0TRj6P98C05qC7WO17fGi_rn7IakIeNmXDswEYhoVR8vSVG2QNSMkMnJSGOiQZ2FlIs3UUiOgOutHTyAg5KPZx_Yja_dtjsc-uiVHwFdXnYxtCJgPP5dr-18Lt4k/s320/Screen+Shot+2017-12-18+at+8.11.40+AM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_pHLUntbXxzDD-DI__UyjAc7tQmA-Oyib5cBAQtXxq6xwjLSibADEueGCnmgXsMp94UMrFNTUGYQSykgqmwTY7QVI5YC5JkGX2rzQyituQ2eVw06R7tfcgPEhv2K59d1yuCTFHxm58E/s1600/Screen+Shot+2017-12-18+at+8.15.58+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="715" data-original-width="1275" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhW_pHLUntbXxzDD-DI__UyjAc7tQmA-Oyib5cBAQtXxq6xwjLSibADEueGCnmgXsMp94UMrFNTUGYQSykgqmwTY7QVI5YC5JkGX2rzQyituQ2eVw06R7tfcgPEhv2K59d1yuCTFHxm58E/s320/Screen+Shot+2017-12-18+at+8.15.58+AM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFp0rUUkvLD2bm4Y9MxcZYdm4fZilAwWkI5eFiJ4fk0OnE9g7PK45dzuqnKzBUken1Y6aJDH7GyJyyMvMIUvKIYdguYgzpCJbAEkSkdlT4rn0spDgPyqUzQDalzU5eNuneU-v8tic6Xow/s1600/Screen+Shot+2017-12-18+at+8.18.31+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="707" data-original-width="1281" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFp0rUUkvLD2bm4Y9MxcZYdm4fZilAwWkI5eFiJ4fk0OnE9g7PK45dzuqnKzBUken1Y6aJDH7GyJyyMvMIUvKIYdguYgzpCJbAEkSkdlT4rn0spDgPyqUzQDalzU5eNuneU-v8tic6Xow/s320/Screen+Shot+2017-12-18+at+8.18.31+AM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM0oVJ-B3Y5HgNi-MG2WMKt0Bz5mlvJP03Bm92_aiRkT0u1w0OvhxZEaUvM6zIoJKlxC3yuGIcG88A9m-IQkcVBZffU_MstGAZYMOMHRkbc96t3ERaXnZEMO0xc941__xo0fPwf6DZhsY/s1600/Screen+Shot+2017-12-18+at+8.20.48+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="690" data-original-width="1268" height="174" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhM0oVJ-B3Y5HgNi-MG2WMKt0Bz5mlvJP03Bm92_aiRkT0u1w0OvhxZEaUvM6zIoJKlxC3yuGIcG88A9m-IQkcVBZffU_MstGAZYMOMHRkbc96t3ERaXnZEMO0xc941__xo0fPwf6DZhsY/s320/Screen+Shot+2017-12-18+at+8.20.48+AM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG0FKVhLptykbJUf7Ak7rb9sbGPxG51j_lCUOauYLpls4J7dUlg4flL5c-S83YrekOjjh5bj-GtFLmoFs1tLcmrW6TK_8dkLr3wIGsE93eHizLYPmd9KovBZL-t_FmiHmG5N5gCXJFE7s/s1600/Screen+Shot+2017-12-18+at+8.27.40+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="710" data-original-width="1272" height="178" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG0FKVhLptykbJUf7Ak7rb9sbGPxG51j_lCUOauYLpls4J7dUlg4flL5c-S83YrekOjjh5bj-GtFLmoFs1tLcmrW6TK_8dkLr3wIGsE93eHizLYPmd9KovBZL-t_FmiHmG5N5gCXJFE7s/s320/Screen+Shot+2017-12-18+at+8.27.40+AM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-tI_mpdZiritbZKjSiHlhMi9v3lBI9XxsBFEZfTiZCT1m0ptAuwQxMtTSl9ypD_f2AbUkGgvvl2x8Y6K6yVAxB3cCJCZJfkHSpJ2N-vFp47c6qS7qNhyphenhyphenNn6JstCxASCXmiSt-CkjISmA/s1600/Screen+Shot+2017-12-18+at+8.33.46+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="706" data-original-width="1288" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-tI_mpdZiritbZKjSiHlhMi9v3lBI9XxsBFEZfTiZCT1m0ptAuwQxMtTSl9ypD_f2AbUkGgvvl2x8Y6K6yVAxB3cCJCZJfkHSpJ2N-vFp47c6qS7qNhyphenhyphenNn6JstCxASCXmiSt-CkjISmA/s320/Screen+Shot+2017-12-18+at+8.33.46+AM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3fVcA13iqt5em9_YhaoAGcou9ccIzD5xvjeQ7MolgA-NxA57nO4XiXRZCQuMtO2oy6bE7S_sT0RimjLMtaom2vRaoAqD4cYmz6AUuPJxR0na-wx7QcSS5Nzm20PeCteF6EKIp3bakhwM/s1600/Screen+Shot+2017-12-18+at+8.44.11+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="692" data-original-width="1262" height="175" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3fVcA13iqt5em9_YhaoAGcou9ccIzD5xvjeQ7MolgA-NxA57nO4XiXRZCQuMtO2oy6bE7S_sT0RimjLMtaom2vRaoAqD4cYmz6AUuPJxR0na-wx7QcSS5Nzm20PeCteF6EKIp3bakhwM/s320/Screen+Shot+2017-12-18+at+8.44.11+AM.png" width="320" /></a></div>
<br />
<br />
Happy Coding!<br />
<br />
Eric<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com2tag:blogger.com,1999:blog-909746912855922547.post-55571632330355963682017-12-14T09:52:00.002-08:002017-12-14T09:52:12.924-08:00Packet Pusher Priority Queue #135 Book DrawingHello, 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. <div>
<br /></div>
<div>
Many of you have listened or at least aware of the episode on <a href="http://packetpushers.net/podcast/podcasts/pq-135-mastering-python-networking-book/#comment-8716">Packet Pusher Priority Queue #135</a> where I discussed <a href="https://www.amazon.com/gp/product/1784397008/ref=s9u_simh_gw_i1?ie=UTF8&fpl=fresh&pd_rd_i=1784397008&pd_rd_r=BQZKFJ3QVF5A5T1ANVZ0&pd_rd_w=B4iFp&pd_rd_wg=7ypBL&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=desktop-1&pf_rd_r=TBZN1MW3TEJYFE86QJ3N&pf_rd_r=TBZN1MW3TEJYFE86QJ3N&pf_rd_t=36701&pf_rd_p=781f4767-b4d4-466b-8c26-2639359664eb&pf_rd_p=781f4767-b4d4-466b-8c26-2639359664eb&pf_rd_i=desktop&pldnSite=1">my book</a> and the subsequent offering of a free autographed copy if you sign up on this <a href="https://app.convertkit.com/landing_pages/275956?v=6">link</a> a month after the airing of the show on November 9th, 2017. </div>
<div>
<br /></div>
<div>
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: </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2W7deJ86tCvAu_pda2-3zLChKrKaL7ZH3DXHfSfym-02sK7HjiokCbxypsTdo2m9hRY9C0hkaBIlpsVpjnvznNSTjIn4tiQUN-Iyo4gYIeFtl6TcD3a_MHfFIaCOuYpDSW5pD0XdoAM0/s1600/Screen+Shot+2017-12-14+at+9.38.54+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1132" data-original-width="1334" height="271" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2W7deJ86tCvAu_pda2-3zLChKrKaL7ZH3DXHfSfym-02sK7HjiokCbxypsTdo2m9hRY9C0hkaBIlpsVpjnvznNSTjIn4tiQUN-Iyo4gYIeFtl6TcD3a_MHfFIaCOuYpDSW5pD0XdoAM0/s320/Screen+Shot+2017-12-14+at+9.38.54+AM.png" width="320" /></a></div>
<div>
<br /></div>
<div>
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: </div>
<div>
<br /></div>
<div>
<div>
1 #!/usr/bin/env python</div>
<div>
2</div>
<div>
3 import random, time</div>
<div>
4</div>
<div>
5</div>
<div>
6 def rand_int(start_num, stop_num, num_range):</div>
<div>
7 for i in range(start_num, stop_num):</div>
<div>
8 number = random.randint(1, num_range)</div>
<div>
9 print("Run: " + str(i) + " Number: " + str(number))</div>
<div>
10 time.sleep(0.1)</div>
<div>
11 print("----")</div>
<div>
12 return number</div>
<div>
13</div>
<div>
14</div>
<div>
15 if __name__ == "__main__":</div>
<div>
16 result = rand_int(2, 11, 272)</div>
<div>
17 print("Congratulations to the person with Number: " + str(result))</div>
<div>
18</div>
</div>
<div>
<br /></div>
<div>
The result was below: </div>
<div>
<br /></div>
<div>
<div>
$ python book_drawing.py</div>
<div>
Run: 2 Number: 11</div>
<div>
----</div>
<div>
Run: 3 Number: 234</div>
<div>
----</div>
<div>
Run: 4 Number: 253</div>
<div>
----</div>
<div>
Run: 5 Number: 207</div>
<div>
----</div>
<div>
Run: 6 Number: 203</div>
<div>
----</div>
<div>
Run: 7 Number: 264</div>
<div>
----</div>
<div>
Run: 8 Number: 20</div>
<div>
----</div>
<div>
Run: 9 Number: 41</div>
<div>
----</div>
<div>
Run: 10 Number: 106</div>
<div>
----</div>
<div>
Congratulations to the person with Number: 106</div>
</div>
<div>
<br /></div>
<div>
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. </div>
<div>
<br /></div>
<div>
If you have a celebrated holiday at the end of the calendar year, I want to wish you happy holidays! If not, happy coding! </div>
<div>
<br /></div>
<div>
Best, </div>
<div>
<br /></div>
<div>
Eric </div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /><div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com4tag:blogger.com,1999:blog-909746912855922547.post-77126694223071565292017-11-07T07:38:00.004-08:002017-11-07T07:44:27.110-08:00Fun Alexa Skill for Mastering Python NetworkingI recently created an Amazon Alexa Skill called "Mastering Python Networking Facts". It went live yesterday. You can check it out here: <a href="https://www.amazon.com/dp/B0775562VH/ref=sr_1_1?s=digital-skills&ie=UTF8&qid=1510067801&sr=1-1&keywords=Mastering+Python+Networking" target="_blank">https://www.amazon.com/dp/B0775562VH/ref=sr_1_1?s=digital-skills&ie=UTF8&qid=1510067801&sr=1-1&keywords=Mastering+Python+Networking</a>. It will give you a fun fact about the book <a href="http://bit.ly/echou-book-packt" target="_blank">Mastering Python Networking (Packt Publishing, June 2017)</a> that was published earlier in the year.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqwtDItRYvrz39-a7RarfGjEHCY96Ra2WIesvyFcaBera5dyEw-JpVYq_F3RPJYK5g3Rqcc5V59ZWoGbEusw-amHAjM7oHObo3NTbojEK7TsiPtf1trnszLkGcekIpR9MwxgupiBcO6Es/s1600/Screen+Shot+2017-11-07+at+7.18.48+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="639" data-original-width="1600" height="127" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqwtDItRYvrz39-a7RarfGjEHCY96Ra2WIesvyFcaBera5dyEw-JpVYq_F3RPJYK5g3Rqcc5V59ZWoGbEusw-amHAjM7oHObo3NTbojEK7TsiPtf1trnszLkGcekIpR9MwxgupiBcO6Es/s320/Screen+Shot+2017-11-07+at+7.18.48+AM.png" width="320" /></a></div>
<br />
Although it is more fun to use this on an Alexa-enabled device, such as <a href="https://www.amazon.com/gp/product/B01DFKC2SO/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B01DFKC2SO&linkCode=as2&tag=pythfornetwen-20&linkId=b551da7ec81f734ffb2e1464978281cb" target="_blank">Echo Dot</a> or <a href="https://www.amazon.com/gp/product/B0749WVS7J/ref=as_li_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B0749WVS7J&linkCode=as2&tag=pythfornetwen-20&linkId=aaf3f95d6f5be1eecfb9ed06b67ef180%22%3EAll-new%20Echo%20(2nd%20Generation)%20with%20improved%20sound,%20powered%20by%20Dolby,%20and%20a%20new%20design%20-%20Heather%20Gray%20Fabric%3C/a%3E%3Cimg%20src=%22//ir-na.amazon-adsystem.com/e/ir?t=pythfornetwen-20&l=am2&o=1&a=B0749WVS7J%22%20width=%221%22%20height=%221%22%20border=%220%22%20alt=%22%22%20style=%22border:none%20!important;%20margin:0px%20!important;%22%20/%3E" target="_blank">Echo</a>, You can test the skill, and any other skills, without such device. You can use:<br />
<br />
1. Web-based EchoSim, <a href="https://echosim.io/">https://echosim.io/</a>. 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.<br />
2. Mobile App Reverb, <a href="https://reverb.ai/">https://reverb.ai/</a>. Use the link on the page to choose the appropriate iOS or Android app. Remember to sign in with the same Amazon account.<br />
<br />
After enabling, an example of the usage would be:<br />
<blockquote class="tr_bq">
[<b>User</b>] Alexa, open Mastering Python Networking Facts.</blockquote>
<blockquote>
[<b>Alexa</b>] The book has a total of 426 pages, more than 100 pages than originally estimated. </blockquote>
It is a variation of the <a href="https://developer.amazon.com/blogs/post/Tx3DVGG0K0TPUGQ/New-Alexa-Skills-Kit-Template:-Step-by-Step-Guide-to-Build-a-Fact-Skill" target="_blank">Alexa Skills Fact Template</a> with two important differentiation:<br />
<br />
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?<br />
2. The 'facts' were populated in DynamoDB table so the content is decoupled from the Skill itself.<br />
<br />
In a later post, I will show you how to write the skill.<br />
<br />
Leave me a comment of how you think the Skill can be improved.<br />
<br />
Happy Python Hacking!<br />
<br />
Eric<br />
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com4tag:blogger.com,1999:blog-909746912855922547.post-51961560196001730482017-10-04T18:35:00.003-07:002019-05-11T17:58:57.857-07:00Mastering Python Networking Book Charity Donation TrackingThis is the place where I keep track of the charity donations from the royalty proceeds of my book, <a href="https://www.packtpub.com/networking-and-servers/mastering-python-networking" target="_blank">Mastering Python Networking</a> (<a href="https://smile.amazon.com/gp/product/1784397008/ref=s9u_simh_gw_i1?ie=UTF8&fpl=fresh&pd_rd_i=1784397008&pd_rd_r=BQZKFJ3QVF5A5T1ANVZ0&pd_rd_w=B4iFp&pd_rd_wg=7ypBL&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=desktop-1&pf_rd_r=TBZN1MW3TEJYFE86QJ3N&pf_rd_r=TBZN1MW3TEJYFE86QJ3N&pf_rd_t=36701&pf_rd_p=781f4767-b4d4-466b-8c26-2639359664eb&pf_rd_p=781f4767-b4d4-466b-8c26-2639359664eb&pf_rd_i=desktop">Amazon.com</a>), by <a href="https://www.packtpub.com/" target="_blank">Packt Publishing</a>.<br />
<br />
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.<br />
<br />
<br />
<a href="https://www.amazon.com/Mastering-Python-Networking-Eric-Chou/dp/1784397008/ref=as_li_ss_il?_encoding=UTF8&me=&linkCode=li2&tag=pythfornetwen-20&linkId=b09c8965dccf483c97289916da72f215" target="_blank"><img border="0" height="200" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=1784397008&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=pythfornetwen-20" width="162" /></a><img alt="" border="0" height="1" src="https://ir-na.amazon-adsystem.com/e/ir?t=pythfornetwen-20&l=li2&o=1&a=1784397008" style="border: none !important; margin: 0px !important;" width="1" /><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<b>[Update 11/05/2018] </b>Second Edition was released on August 28th, 2018 (<a href="https://amzn.to/2PkMRiZ">Amazon.com</a>)! I will donate the proceeds to charity from the second edition as well.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbWAG45BHGfLBT1OS-AX4-RgO2BRKUhbIpZBF8AqE7SwPt3rWju5UKN8W3p1PW7Csker4Hn3HLG1Es6GTqiaRNhw0EN1lFFua_mhastgXQNgL3rUCSUANBXmGzhiT1UfgcsqDWmtMyZeU/s1600/Screen+Shot+2018-11-05+at+2.09.36+PM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="312" data-original-width="253" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbWAG45BHGfLBT1OS-AX4-RgO2BRKUhbIpZBF8AqE7SwPt3rWju5UKN8W3p1PW7Csker4Hn3HLG1Es6GTqiaRNhw0EN1lFFua_mhastgXQNgL3rUCSUANBXmGzhiT1UfgcsqDWmtMyZeU/s200/Screen+Shot+2018-11-05+at+2.09.36+PM.png" width="162" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<b><br /></b> <b>*****</b><br />
<b><br /></b> <b>June 2017</b><br />
<br />
- SmileTrain (<a href="https://www.smiletrain.org/">https://www.smiletrain.org</a>)<br />
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
<br />
<b>August 2017</b><br />
<br />
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
- Python Software Foundation (<a href="https://www.python.org/psf/">https://www.python.org/psf/</a>)<br />
<br />
<b>September 2017</b><br />
<br />
- Lake Washington Schools Foundation Pantry Pack (<a href="http://www.lwsf.org/pantrypacks.html">http://www.lwsf.org/pantrypacks.html</a>)<br />
- 21 US Virgin Island Relief Fund (<a href="https://www.youcaring.com/21usvirginislandrelieffund-942738">https://www.youcaring.com/21usvirginislandrelieffund-942738</a>)<br />
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
<br />
<b>October 2017</b><br />
<br />
- PyLadies (<a href="http://www.pyladies.com/sponsor/">http://www.pyladies.com/sponsor/</a>)<br />
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
<!--?xml version="1.0" encoding="UTF-8"?--> - Python Seattle Chapter thru PSF<br />
- Humble Bundle for PSF<br />
<br />
<b>November 2017</b><br />
<b><br /></b>- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
- Imagine1Day (<a href="https://imagine1day.org/">https://imagine1day.org/</a>)<br />
<b><br /></b> <b>December 2017</b><br />
<b><br /></b>- Tzu Chi Foundation (<a href="https://www.tzuchi.us/">https://www.tzuchi.us/</a>)<br />
<b><br /></b> <b>January 2018</b><br />
<br />
- Humble Bundle (<a href="https://www.humblebundle.com/">https://www.humblebundle.com/</a>)<br />
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
- Leukemia & Lymphoma Society (<a href="http://www.lls.org/">http://www.lls.org/</a>)<br />
- UNICEF (<a href="https://www.unicefusa.org/">https://www.unicefusa.org/</a>)<br />
<br />
<b>February 2018 </b><br />
<br />
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
<div>
- Every Town for Gun Safety (https://everytown.org/)</div>
<div>
<br /></div>
<div>
<b>March 2018</b></div>
<div>
<br /></div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)</div>
<div>
<br /></div>
<div>
<b>April 2018</b></div>
<div>
<br /></div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)</div>
<div>
<br /></div>
<div>
<b>May 2018</b></div>
<div>
<br /></div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)</div>
<div>
<br /></div>
<div>
<b>June 2018</b></div>
<div>
<br /></div>
<div>
- Fundraiser for Mkwanazi Compassion International</div>
<div>
<br /></div>
<div>
<b>July 2018</b></div>
<div>
<br /></div>
<div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)</div>
</div>
<div>
<br /></div>
<div>
<b>August 2018</b></div>
<div>
<br /></div>
<div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)</div>
</div>
<div>
<br /></div>
<div>
<b>September 2018</b></div>
<div>
<br /></div>
<div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)</div>
</div>
<div>
<br /></div>
<div>
<b>October 2018</b></div>
<br />
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
- Lake Washington School District (https://www.lwsd.org/) </div>
<div>
<br /></div>
<div>
<b>November 2018</b></div>
<div>
<br /></div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
<br />
<div>
<b>December 2018</b></div>
<div>
<br /></div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)</div>
<br />
<div>
<b>January 2019</b></div>
<div>
<br /></div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
- Humble Bundle (<a href="https://www.humblebundle.com/">https://www.humblebundle.com/</a>)<br />
<br />
<div>
<b>February 2019</b></div>
<div>
<br /></div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
<br />
<div>
<b>March 2019</b></div>
<div>
<br /></div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)</div>
</div>
</div>
</div>
<div>
<br /></div>
<div>
<div>
<b>April 2019</b></div>
<div>
<br /></div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)</div>
</div>
<div>
<br /></div>
<div>
<div>
<b>May 2019</b></div>
<div>
<br /></div>
<div>
- Python Software Foundation 2019 Q2 drive (<a href="https://www.python.org/psf/donations/2019-q2-drive/">https://www.python.org/psf/donations/2019-q2-drive/</a>)</div>
</div>
<div>
- Tzu Chi Foundation (<a href="http://www.tzuchi.us/">http://www.tzuchi.us/</a>)<br />
- Humble Bundle (<a href="https://www.humblebundle.com/">https://www.humblebundle.com/</a>)</div>
<div>
<br /></div>
<div>
[To be continued..]</div>
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com3tag:blogger.com,1999:blog-909746912855922547.post-9041419060517507292017-07-06T16:28:00.000-07:002017-07-06T16:28:35.729-07:00Mastering Python Networking Book Q&AIt has been an incredible last few months for personal and professional growth in writing and publishing my first book, <a href="https://www.packtpub.com/networking-and-servers/mastering-python-networking">Mastering Python Networking</a> (<a href="https://smile.amazon.com/gp/product/1784397008/ref=s9u_simh_gw_i1?ie=UTF8&fpl=fresh&pd_rd_i=1784397008&pd_rd_r=BQZKFJ3QVF5A5T1ANVZ0&pd_rd_w=B4iFp&pd_rd_wg=7ypBL&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=desktop-1&pf_rd_r=TBZN1MW3TEJYFE86QJ3N&pf_rd_r=TBZN1MW3TEJYFE86QJ3N&pf_rd_t=36701&pf_rd_p=781f4767-b4d4-466b-8c26-2639359664eb&pf_rd_p=781f4767-b4d4-466b-8c26-2639359664eb&pf_rd_i=desktop">Amazon.com Link</a>), by <a href="https://www.packtpub.com/">Packt Publishing</a>. 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.<br />
<br />
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.<br />
<br />
<a href="https://www.amazon.com/Mastering-Python-Networking-Eric-Chou/dp/1784397008/ref=as_li_ss_il?_encoding=UTF8&me=&linkCode=li2&tag=pythfornetwen-20&linkId=b09c8965dccf483c97289916da72f215" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=1784397008&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=pythfornetwen-20" /></a><img alt="" border="0" height="1" src="https://ir-na.amazon-adsystem.com/e/ir?t=pythfornetwen-20&l=li2&o=1&a=1784397008" style="border: none !important; margin: 0px !important;" width="1" /><br />
<br />
******<br />
<br />
<b><i>Q. What is the motivation for the book? </i></b><br />
<b><br /></b>
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.<br />
<br />
<i><b>Q. How did you get the opportunity from Packt Publishing?</b> </i><br />
<br />
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.<br />
<br />
<b><i>Q. What is the book about? </i></b><br />
<br />
A. You can read the book description <a href="https://www.packtpub.com/networking-and-servers/mastering-python-networking">here</a>. Basically it is about how to automate network tasks with Python packages.<br />
<br />
<i><b>Q. Where can I get the book?</b> </i><br />
<br />
A. I am glad you asked! You can get the book here on <a href="https://www.packtpub.com/networking-and-servers/mastering-python-networking">Packt</a> website or <a href="https://smile.amazon.com/gp/product/1784397008/ref=s9u_simh_gw_i1?ie=UTF8&fpl=fresh&pd_rd_i=1784397008&pd_rd_r=BQZKFJ3QVF5A5T1ANVZ0&pd_rd_w=B4iFp&pd_rd_wg=7ypBL&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=desktop-1&pf_rd_r=TBZN1MW3TEJYFE86QJ3N&pf_rd_r=TBZN1MW3TEJYFE86QJ3N&pf_rd_t=36701&pf_rd_p=781f4767-b4d4-466b-8c26-2639359664eb&pf_rd_p=781f4767-b4d4-466b-8c26-2639359664eb&pf_rd_i=desktop">Amazon</a>.<br />
<br />
<b><i>Q. Can I take a look at the book first before purchase? </i></b><br />
<br />
A. Sure! This book is part of the Packt subscription library that you can start a 30-day free trial for.<br />
<br />
<b><i>Q. Where can I get the code used in the book? </i></b><br />
<br />
A. You can get the code from the book page as well as the <a href="https://github.com/PacktPublishing/Mastering-Python-Networking">Packt GitHub repository</a>.<br />
<br />
<b><i>Q. What are you doing with the money from the book? </i></b><br />
<br />
A. All royalties from the book will be donated to charity, although I have not decided where yet.<br />
<br />
<b><i>Q. Are you interested in writing more books? </i></b><br />
<br />
A. Absolutely! But I need to take a break first to recharge. :)<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com5tag:blogger.com,1999:blog-909746912855922547.post-16483143667461316472017-06-27T05:16:00.000-07:002017-06-27T05:16:46.373-07:00Scalable Text SMS SystemI 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.<br />
<br />
That is why it was so exciting to see a service like <a href="https://www.twilio.com/">Twilio</a> 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:<br />
<br />
<a href="https://www.twilio.com/blog/2017/06/build-serverless-api-amazon-web-services-api-gateway.html">https://www.twilio.com/blog/2017/06/build-serverless-api-amazon-web-services-api-gateway.html</a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3C4c3eu1n8gs5yV2GU6F-op7gZjRpXN9FHmtaQzGjO7ceIlOp_srnsf94vNr7t2a258Vo-iyz_wXMv2qAEgl7_fFfzWkFQs5Polt8cZ0MNjWBa9zL6SrxVLXOz6rPjvOWdLDuP9hLpRU/s1600/Screen+Shot+2017-06-23+at+10.43.51+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="663" data-original-width="1205" height="220" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3C4c3eu1n8gs5yV2GU6F-op7gZjRpXN9FHmtaQzGjO7ceIlOp_srnsf94vNr7t2a258Vo-iyz_wXMv2qAEgl7_fFfzWkFQs5Polt8cZ0MNjWBa9zL6SrxVLXOz6rPjvOWdLDuP9hLpRU/s400/Screen+Shot+2017-06-23+at+10.43.51+AM.png" width="400" /></a></div>
<br />
As always, happy coding!<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com1tag:blogger.com,1999:blog-909746912855922547.post-46671230066658381442016-11-22T05:58:00.000-08:002016-11-22T05:58:33.083-08:00LittleBits Summer EventIf 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.<br />
<br />
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.<br />
<br />
Which was why I was super excited to learn that Microsoft Store is now carrying the LittleBits kits at the store.<br />
<a href="http://link.littlebits.cc/view/5592a4a715dd96fd06b135134893g.1fi/07ef807a" target="_blank">http://link.littlebits.cc/view/5592a4a715dd96fd06b135134893g.1fi/07ef807a</a><br />
<br />
Maybe somebody was listening and this was the first step to carry out the idea I proposed? One can only hope... :)<br />
<br />
Happy Coding!Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com4tag:blogger.com,1999:blog-909746912855922547.post-33570957376998489672016-11-15T07:27:00.001-08:002016-11-15T07:27:10.374-08:00Voice User Interface with Alexa - First ImpressionIt 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.<br />
<br />
The biggest question on Alexa for me was this:<br />
<br />
<blockquote class="tr_bq">
"Who needs a voice interface when we have virtual reality, Kinect, and a super computer that fits in your palm?" </blockquote>
<br />
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.<br />
<br />
I am a fan of <a href="https://stratechery.com/" target="_blank">StraTechery</a>, 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 <a href="https://echosim.io/" target="_blank">EchoSim</a> to simulate an voice controlled device and tied it to the back end.<br />
<br />
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:<br />
<br />
1. You don't always have a phone with you at home, and Echo is precisely a home-based device.<br />
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.<br />
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.<br />
<br />
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.<br />
<br />
Stay tune for my next blog post about how I eventually was able to build my first "Hello World" app on Alexa.<br />
<br />
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! :)<br />
<br />
Happy Coding!<br />
<br />
<br />
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com1tag:blogger.com,1999:blog-909746912855922547.post-54288205236991779452016-11-01T08:22:00.000-07:002016-11-01T08:22:55.467-07:00My New Favorite Chrome Extension - Momentum<div class="separator" style="clear: both; text-align: left;">
Chrome extensions are pretty awesome, with Google's announcement for <a href="http://www.theverge.com/2016/8/19/12555052/google-shutting-down-chrome-apps" target="_blank">end of support</a> for Chrome Apps, Chrome extensions will have greater importance to the game. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I discovered Momentum earlier today when I was watching a YouTube video of Google Hangout. When he switch to a new tab, I saw this beautiful page that read "What is Your Main Focus for Today?". Which instinctively I asked myself "What IS my main focus for today?" So I pause the video and went on Google Web Store and found Momentum. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://chrome.google.com/webstore/detail/momentum/laookkfknpbbblfpciffpaejjkokdgca" target="_blank">https://chrome.google.com/webstore/detail/momentum/laookkfknpbbblfpciffpaejjkokdgca</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9M87tCxxcqe17_JVEYwtnmTvbmDD5zF-1Auaio3VlnQCMKNSWahGHVu9RjUahbNTwAOP2a9BfWpZ5bUE-AF-JwdpdYr3qFSFTOQPl3KGuSspCKLtca8X2p6mtbHsXjS2TD2Xft8OZb2w/s1600/Screen+Shot+2016-09-24+at+11.43.10+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="199" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9M87tCxxcqe17_JVEYwtnmTvbmDD5zF-1Auaio3VlnQCMKNSWahGHVu9RjUahbNTwAOP2a9BfWpZ5bUE-AF-JwdpdYr3qFSFTOQPl3KGuSspCKLtca8X2p6mtbHsXjS2TD2Xft8OZb2w/s320/Screen+Shot+2016-09-24+at+11.43.10+AM.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
What was a pleasant surprise is that besides the picture and weather information, you can input your own task items, cross it out, add a new item, etc. All without logging in. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8QF291LbjEEBHfL-cI2t07n_IyayQPhOtZdcDLqcGCKSo-ju8gXYLsLLRBXWZdmpxWSsF6N5aIIIUGJ0zYfpxNp_OMpGPTsh1ENzFHi8z2Vz3YeMUD70FZZr1JnUWHGcQvVg4rbHWZBw/s1600/Screen+Shot+2016-09-24+at+11.43.25+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8QF291LbjEEBHfL-cI2t07n_IyayQPhOtZdcDLqcGCKSo-ju8gXYLsLLRBXWZdmpxWSsF6N5aIIIUGJ0zYfpxNp_OMpGPTsh1ENzFHi8z2Vz3YeMUD70FZZr1JnUWHGcQvVg4rbHWZBw/s320/Screen+Shot+2016-09-24+at+11.43.25+AM.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I enjoyed being reminded of my main focus everyday with inspirational quotes and beautiful images in the background. I hope you do too! </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Happy Coding! :)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com2tag:blogger.com,1999:blog-909746912855922547.post-55532616045093595062016-10-11T23:06:00.000-07:002016-10-11T23:06:58.299-07:00Combine Facebook API with Twitter BotIt has been a while since I <a href="http://blog.pythonicneteng.com/2013/12/project-mining-social-web-2nd-edition_31.html" target="_blank">last looked at</a> Facebook Graph API. I had a small project that would benefit from crawling a Facebook group, here is what I want to do:<br />
<br />
1. Crawl a Facebook group for feed periodically.<br />
2. Parse out the Feeds for a particular person.<br />
3. Tweet to me when that happens.<br />
<br />
For #1 and #3, I have already done that before with Twython and AWS Lambda in this <a href="http://blog.pythonicneteng.com/2016/09/make-twitter-bot-in-python-and-aws.html" target="_blank">post</a>. So I just need to figure out how to crawl Facebook group. Here were the steps I took:<br />
<br />
1. Create a Facebook App ID and get App secret. This is pretty easy and self-explanatory.<br />
<br />
2. Use the Facebook <a href="https://developers.facebook.com/docs/graph-api/" target="_blank">Graph API Page</a> and Documentation to find the right URI to get the feed that you want. This was the most time consuming as Facebook changes access rights from version to version, and there are differences between App Token and User Token. What I finally found was using the User Token for version 2.2 (latest was 2.7) was what I needed.<br />
<br />
Here is the curl example. You can get the group ID from going directly to the Facebook group and looking at the URI. The feed limit is just to speed up the response:<br />
<br />
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
○ → curl -i -X GET \</div>
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<br />
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
> "https://graph.facebook.com/v2.2/<facebook group ID>?fields=feed.limit(10)&access_token=<token>" </div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
3. The user token is only good for about an hour, you can make it a 60 day long term token. Here was the <a href="https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension" target="_blank">Facebook LInk</a>, but I find <a href="http://www.slickremix.com/facebook-60-day-user-access-token-generator/" target="_blank">this instruction</a> to be much easier. </div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
4. Now that I have the feed, I just need to parse it out for message, creation time, and other fields that I wanted and fill in what I did before for Twitter bot and upload to Lambda. One thing that I did wrong was previously using update_status which spammed all of my followers, so I switched to direct_message. Here is the code: </div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div>
<div>
<br /></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">import requests, pprint, json, re, datetime</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">from twython import Twython</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">from twython.exceptions import TwythonError</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">with open('credentials.json') as f:</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> credentials = json.loads(f.read())</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">client = Twython(credentials["consumer_key"],</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> credentials["consumer_secret"],</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> credentials["access_token_key"],</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> credentials["access_token_secret"])</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">url = "https://graph.facebook.com/v2.2/<group>?fields=feed.limit(50)&access_token=<long term access token>"</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">def lambda_handler(event, context):</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> r = requests.get(url)</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> for i in r.json()['feed']['data']:</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> if i['from']['id'] == '<some user ID>':</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> if re.search('shirt', i['message']):</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> name = (i['from']['name'])</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> #print(i['from']['id'])</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> createdTime = (i['created_time'])</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> message = (i['message'])</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> print("Tweeting..")</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> text = <your text></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"> client.send_direct_message(screen_name="<some user>", text = text)</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">Thanks for reading. Happy Coding!</span></span></div>
<div style="font-family: "Helvetica Neue"; font-size: 14px;">
<br /></div>
</div>
<div style="font-family: "Helvetica Neue"; font-size: 14px;">
<br /></div>
Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com1tag:blogger.com,1999:blog-909746912855922547.post-26562861885260242542016-10-04T14:25:00.000-07:002016-10-04T14:25:44.504-07:00Google Coder for Raspberry Pi - for Kids and AdultsMy wife sent me this link for <a href="http://googlecreativelab.github.io/coder/" target="_blank">Coder for Raspberry Pi</a> a while back, but it wasn't until today (after a friendly reminder) that I began to set it up for her and the kid. The project was created by a small team of Googlers in New York, in their own words:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGbRW4sYhyphenhyphenO_5-3othWHCVucT4Muu8MqxLTR369ZEigY5NDuLNpZX-TpaoGpNKdzcQr-lLezAk93qE8V11qU0Ng4cgIkszmi3So5jiM3aDymN0gjIgYyhxy81EPzOCz0lNlE_kSQAhyvA/s1600/Screen+Shot+2016-08-29+at+7.29.41+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="496" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGbRW4sYhyphenhyphenO_5-3othWHCVucT4Muu8MqxLTR369ZEigY5NDuLNpZX-TpaoGpNKdzcQr-lLezAk93qE8V11qU0Ng4cgIkszmi3So5jiM3aDymN0gjIgYyhxy81EPzOCz0lNlE_kSQAhyvA/s640/Screen+Shot+2016-08-29+at+7.29.41+PM.png" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
Well, sounds good to me! Set up was a breeze, at least for Mac it was a zip file that you download. Once unzipped, you get a 'CodeSetup' icon that you double click to launch:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG09N6IdLpH7tiHAmSOhu7g8_b1c9jXOzs9cutgkOcBLI993B3ShpMNHoQ82HRGcFJBPuUwNqLHwX3-y9qnv07v58seMVPnItLAd3Mk1VzcIhVDuVrYYnp8Pv9YF_K95Owv9DSuLyPlG0/s1600/Screen+Shot+2016-08-29+at+7.24.47+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgG09N6IdLpH7tiHAmSOhu7g8_b1c9jXOzs9cutgkOcBLI993B3ShpMNHoQ82HRGcFJBPuUwNqLHwX3-y9qnv07v58seMVPnItLAd3Mk1VzcIhVDuVrYYnp8Pv9YF_K95Owv9DSuLyPlG0/s320/Screen+Shot+2016-08-29+at+7.24.47+PM.png" width="320" /></a></div>
<br />
It will then ask to start the process, plug in your SD Card, then unplug it when the image is transferred to the SD card.<br />
<br />
You can then access the device via 'http://coder.local'. When you access it for the first time, it will ask you to change your password, then re-enter it with the new password.<br />
<br />
If you have Raspberry Pi compatible wireless adaptor you can then set up WiFi in the setup menu.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnt77yXkb7dv6qh6KwyfvkE14PR-7w_ASpaadvLHFIXP-efCbX6A12tp-ie8ZxBXXzX5X0Q54nBXP5zYiFdoGcCBznhkHBZUtFgNIvNOhM605wRlfeJ9y52oUupmZNQ2CErAKcaFMu0sA/s1600/Screen+Shot+2016-08-29+at+7.36.53+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="172" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnt77yXkb7dv6qh6KwyfvkE14PR-7w_ASpaadvLHFIXP-efCbX6A12tp-ie8ZxBXXzX5X0Q54nBXP5zYiFdoGcCBznhkHBZUtFgNIvNOhM605wRlfeJ9y52oUupmZNQ2CErAKcaFMu0sA/s320/Screen+Shot+2016-08-29+at+7.36.53+PM.png" width="320" /></a></div>
<br />
The only additional thing I wanted to change the default 'coder.local' name to something else since I set up one for me, wife, and kid. No problem, this was explained in the FAQ:<br />
<br />
<a href="https://github.com/googlecreativelab/coder/wiki/Using-Multiple-Coder-Devices-(Lab-Setup)" target="_blank">Using Multiple Coder on the Network</a><br />
<br />
Awesome, a quick peek shows that it is very visual, any HTML / CSS / JavaScript change you do will immediately reflected on the page. For example, this nice (scary?) looking eyeball that follows your mouse around. :)<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmRzPpO64Rlc9OP-zMzFNab6uVMD2blkp0nVPPuicWaZ4NwirEi0CphvnwmoFE4CtiNZFYfLt6noNspCynKn4rknS2_RTL1QNgIkducgj6gZLTPzRbSYcwhxG4CURD790KNC1fn1uUjKY/s1600/Screen+Shot+2016-08-29+at+7.24.28+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="195" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmRzPpO64Rlc9OP-zMzFNab6uVMD2blkp0nVPPuicWaZ4NwirEi0CphvnwmoFE4CtiNZFYfLt6noNspCynKn4rknS2_RTL1QNgIkducgj6gZLTPzRbSYcwhxG4CURD790KNC1fn1uUjKY/s320/Screen+Shot+2016-08-29+at+7.24.28+PM.png" width="320" /></a></div>
<br />
<br />
I look forward to experiment with this nice project more with wife and kid. Looks like it is a full stack with Node.js in the backend. Not sure at this point.<br />
<br />
Oh yeah, if you want to ssh to the Pi, the username is still pi and password is your new password:<br />
<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
MacBook-Air:5_Requests echou$ ssh pi@coder-eric.local</blockquote>
<blockquote class="tr_bq">
<skip> </blockquote>
</blockquote>
<blockquote class="tr_bq">
<blockquote class="tr_bq">
Warning: Permanently added 'coder-eric.local,192.168.2.118' (ECDSA) to the list of known hosts.</blockquote>
<blockquote class="tr_bq">
pi@coder-eric.local's password:</blockquote>
<blockquote class="tr_bq">
Linux coder-eric 3.18.7+ #756 PREEMPT Wed Feb 18 16:08:51 GMT 2015 armv6l</blockquote>
<blockquote class="tr_bq">
<br /></blockquote>
<blockquote class="tr_bq">
The programs included with the Debian GNU/Linux system are free software;</blockquote>
<blockquote class="tr_bq">
the exact distribution terms for each program are described in the</blockquote>
<blockquote class="tr_bq">
individual files in /usr/share/doc/*/copyright.</blockquote>
<blockquote class="tr_bq">
<br /></blockquote>
<blockquote class="tr_bq">
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent</blockquote>
<blockquote class="tr_bq">
permitted by applicable law.</blockquote>
<blockquote class="tr_bq">
Last login: Sat Feb 21 06:27:55 2015</blockquote>
<blockquote class="tr_bq">
pi@coder-eric ~ $</blockquote>
</blockquote>
<br />
I had enough time to poke around a little bit, seems like using Node.js (maybe Express) in the backend as webserver:<br />
<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
pi@coder-eric ~/tmp/npm-7237 $ npm --version</blockquote>
<blockquote class="tr_bq">
1.2.21</blockquote>
<blockquote class="tr_bq">
pi@coder-eric ~/tmp/npm-7237 $ node --version</blockquote>
<blockquote class="tr_bq">
v0.10.7</blockquote>
<blockquote class="tr_bq">
pi@coder-eric ~/tmp/npm-7237 $</blockquote>
</blockquote>
<br />
Here is their <a href="https://github.com/googlecreativelab/coder" target="_blank">Coder GitHub Page</a> if you want to take a look at the actual code.<br />
<br />
Cheers!<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com0tag:blogger.com,1999:blog-909746912855922547.post-8973775678339554742016-09-27T07:42:00.000-07:002016-09-27T07:42:01.328-07:00Adafruit Circuit Playground Second Hour<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<br />
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">If you have followed last week's post on Adafruit's Circuit Playground, you now have a working communication between your computer and the board. In this example, I would like to establish the communication between my Raspberry Pi over the serial communication to the board. This way I can leverage everything the RasPi has while utilizing the sensors and outputs from the board. </span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">The package I need is PySerial, which can be installed via 'sudo pip install pyserial'. It is used as the 'serial' package in Python code. </span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">Here is the objective: </span></span></div>
<ol style="font-family: 'Helvetica Neue'; font-size: 14px;">
<li>The Arduino code will print out serial output when either the right or left button is pressed.</li>
<li>When the B key is pressed, the LED light will light up one at a time. </li>
<li>In the Python code we will send the letter B 9 times then wait for any serial input</li>
</ol>
<div>
<span style="font-family: "helvetica neue"; font-size: 14px;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkp3nmwPrN6QlhyphenhyphentLPCAjZJleRgqS-qyHmhS7wnb8_qm2-Kd_1ceRXB5SEo43ktIKV-hBqfi6IVbChzSPSXV5sUR98BTLT1xG6kikpIXQM2raUDmV_vnM3dNoKG6FRb20I9eE8J_Ld9Dw/s1600/Screen+Shot+2016-08-27+at+8.24.03+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkp3nmwPrN6QlhyphenhyphentLPCAjZJleRgqS-qyHmhS7wnb8_qm2-Kd_1ceRXB5SEo43ktIKV-hBqfi6IVbChzSPSXV5sUR98BTLT1xG6kikpIXQM2raUDmV_vnM3dNoKG6FRb20I9eE8J_Ld9Dw/s320/Screen+Shot+2016-08-27+at+8.24.03+PM.png" width="286" /></a></div>
<div>
<span style="font-family: "helvetica neue"; font-size: 14px;"><br /></span></div>
<div>
<span style="font-family: "helvetica neue"; font-size: 14px;">Here is the Python code. Python Code. A few notes: </span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">- Raspberry Pi the serial port is /dev/ttyACM0 and /dev/cu.usbmodem142 on Mac, therefore I comment out the line depending on if I am on the Mac or Raspberry Pi. </span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">- The character is sent as Bytecode, so chr(0x42) is used for letter 'B'. Here is an ASCII table. </span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgszejvPgq8GM0DpfTmIRPx-XfAW5VhlacsIJiEs5665Pc4sALukZS2vL0PpsTOq7k0KGS7vbd54XN7fPONhyphenhyphenPf65GCSUwgG3mJcCGC1rPSKo6iYHQoyOC2sivd9kkNTtE5Nv28Kyge25k/s1600/Screen+Shot+2016-08-27+at+8.06.56+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgszejvPgq8GM0DpfTmIRPx-XfAW5VhlacsIJiEs5665Pc4sALukZS2vL0PpsTOq7k0KGS7vbd54XN7fPONhyphenhyphenPf65GCSUwgG3mJcCGC1rPSKo6iYHQoyOC2sivd9kkNTtE5Nv28Kyge25k/s320/Screen+Shot+2016-08-27+at+8.06.56+PM.png" width="320" /></a></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">- Timeout of 1 second is used to gradually light up the LED. </span></span></div>
<blockquote class="tr_bq">
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<br />
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
import serial
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
import time
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
#ser = serial.Serial('/dev/ttyACM0', 9600)
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
ser = serial.Serial('/dev/cu.usbmodem1421', 9600)
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
# ASCII character 'B'
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
sendChr = chr(0x42)
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
# Send character B which turns on light one at a time
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
for i in range(9):
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
ser.write(sendChr)
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
time.sleep(1)
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
# Read the input from board
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
while True:
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
message = ser.readline()
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
print(message) </div>
</blockquote>
<div>
<br /></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">Here is the Arduino Code: </span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">- I am using the Demo code provided by Adafruit:</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkrhJaUg1o2cHneD5mmlc3IyRLWCObU7BA7ScspMMRxg4oqEjoof5iB2VzSjrpE4c3fgc-n09gb0NnZBXtrBi1vOvcQYWJ4jpakJrzLFMbK1mvddlGgUBjDJzP_bUlXR7zhbgVjmFy93k/s1600/Screen+Shot+2016-08-27+at+8.47.01+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkrhJaUg1o2cHneD5mmlc3IyRLWCObU7BA7ScspMMRxg4oqEjoof5iB2VzSjrpE4c3fgc-n09gb0NnZBXtrBi1vOvcQYWJ4jpakJrzLFMbK1mvddlGgUBjDJzP_bUlXR7zhbgVjmFy93k/s320/Screen+Shot+2016-08-27+at+8.47.01+PM.png" width="275" /></a></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">- Use the library manager to install the Adafruit Circuit Playground Libraries</span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn-qmiTbED_Box5EhoSuIbWagdiqcRRZHJoL7hj5RaWLYcUiAkVUJqZoXLdeuBZM4OxBzDEuMPHuuwMuLMQsqzlcRigBuUSI3ZAgJYkEHrH2sL5iTVIRyRzhyvbYCBObHsPRBj7Ie2ENQ/s1600/Screen+Shot+2016-08-27+at+8.48.59+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn-qmiTbED_Box5EhoSuIbWagdiqcRRZHJoL7hj5RaWLYcUiAkVUJqZoXLdeuBZM4OxBzDEuMPHuuwMuLMQsqzlcRigBuUSI3ZAgJYkEHrH2sL5iTVIRyRzhyvbYCBObHsPRBj7Ie2ENQ/s320/Screen+Shot+2016-08-27+at+8.48.59+PM.png" width="256" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj70UbFo7gH6ql4e7LBre5xFqu8GXlElqFh7B7PtjAIB20cJfjrqij2nVWkt4d57FzdKdQQuk6KNzg-fl16F4f9Rz6Ie1zQITsNcndcZw4qmNOYxqPclVluZYPCS2yiEvb6Qfb6WcE0ing/s1600/Screen+Shot+2016-08-27+at+8.48.23+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="68" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj70UbFo7gH6ql4e7LBre5xFqu8GXlElqFh7B7PtjAIB20cJfjrqij2nVWkt4d57FzdKdQQuk6KNzg-fl16F4f9Rz6Ie1zQITsNcndcZw4qmNOYxqPclVluZYPCS2yiEvb6Qfb6WcE0ing/s320/Screen+Shot+2016-08-27+at+8.48.23+PM.png" width="320" /></a></div>
<br />
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<blockquote class="tr_bq">
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<br />
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
// Demo program for testing library and board - flip the switch to turn on/off buzzer
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
#include <Adafruit_CircuitPlayground.h>
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
#include <Wire.h>
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
#include <SPI.h>
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
// we light one pixel at a time, this is our counter
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
uint8_t pixeln = 0;
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
byte byteRead;
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
void setup() {
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
//while (!Serial);
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
Serial.begin(9600);
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
Serial.println("Circuit Playground test!");
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
CircuitPlayground.begin();
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
}
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
void loop() {
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
/************* TEST BOTH BUTTONS */
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
if (CircuitPlayground.leftButton()) {
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
Serial.println("Left button pressed!");
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
}
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
delay(100);
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
if (CircuitPlayground.rightButton()) {
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
Serial.println("Right button pressed!");
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
}
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
delay(100);
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
/************** Read Serial In, 65 DEC ASCII is letter B */
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
byteRead = Serial.read();
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
if(byteRead == 66) {
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
Serial.println("Letter B input, turn on light");
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
//Serial.write(byteRead);
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
CircuitPlayground.redLED(HIGH);
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
delay(100);
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
CircuitPlayground.redLED(LOW);
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
delay(100);
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
CircuitPlayground.setPixelColor(pixeln++, CircuitPlayground.colorWheel(25 * pixeln));
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
if (pixeln == 11) {
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
pixeln = 0;
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
CircuitPlayground.clearPixels();
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
}
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
}
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
}
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
</div>
</blockquote>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">Another screenshot for the IDE: </span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxISn4lr-JzUE2Mrgk4O_lRBsSSKBgUUL0H2yYyFTFdJZYYMOHdaVrjJwTJtSlyQaeDXK2H5XFcjuIjW4a-QOupSynjN9ZZuUamEdYdK0PnuhRVuXPEYJ5loSAdZEfol4PRhwmczL_79w/s1600/Screen+Shot+2016-08-27+at+8.18.44+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxISn4lr-JzUE2Mrgk4O_lRBsSSKBgUUL0H2yYyFTFdJZYYMOHdaVrjJwTJtSlyQaeDXK2H5XFcjuIjW4a-QOupSynjN9ZZuUamEdYdK0PnuhRVuXPEYJ5loSAdZEfol4PRhwmczL_79w/s320/Screen+Shot+2016-08-27+at+8.18.44+PM.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
You can also use the serial monitor included with the Arduino IDE to test: </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhveWDsc8MffswetlR5fdWrB-TbdQLP3fFyPrHaNMTrRitXybHUHjfNrV2MLDLy25Ul_Ej__AW-7hx0EOXfGWET0HNUun57mj39X2D4yXNGXcBSre9pO5r7IZ6MotpuWo-QJ6weHSnTxtA/s1600/Screen+Shot+2016-08-27+at+8.21.41+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhveWDsc8MffswetlR5fdWrB-TbdQLP3fFyPrHaNMTrRitXybHUHjfNrV2MLDLy25Ul_Ej__AW-7hx0EOXfGWET0HNUun57mj39X2D4yXNGXcBSre9pO5r7IZ6MotpuWo-QJ6weHSnTxtA/s320/Screen+Shot+2016-08-27+at+8.21.41+PM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;">This is really fun, I cant wait to see all the possibilities when combining the two! </span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
<div>
<span style="font-family: "helvetica neue";"><span style="font-size: 14px;"><br /></span></span></div>
Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com0tag:blogger.com,1999:blog-909746912855922547.post-16936693466108581732016-09-20T08:14:00.000-07:002016-09-20T08:14:19.256-07:00Adafruit Circuit Playground First HourThe <a href="https://learn.adafruit.com/introducing-circuit-playground/overview" target="_blank">Adafruit Circuit Playground</a> arrive a few days ago. I remember seeing it for the first time at PyCon 2016 when Tony D. had a demo board and I was really impressed by it. Imagine a board not much bigger than a regular US quarter PACKED with sensors.<br />
<br />
Here are two quick demos with playing some sound on the board:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/rwnrQJ7f7xI/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/rwnrQJ7f7xI?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/98OOFm6CuP4/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/98OOFm6CuP4?feature=player_embedded" width="320"></iframe></div>
<br />
<br />
Source: https://www.adafruit.com/<br />
<br />
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWeJ-EOgax1GpQaPFCI0wpP5zGpVZI_zEfDaLo1FgStycrhCD35rLY_W_Nia1rcKYSSU6VjbkHSvxUIb5gasXZOUd_EJGRWIKBOsQM8JukWWYJYonamsFrVad9R5Xn0GsCI4CBq71O1S4/s1600/Screen+Shot+2016-08-21+at+9.44.14+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="328" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWeJ-EOgax1GpQaPFCI0wpP5zGpVZI_zEfDaLo1FgStycrhCD35rLY_W_Nia1rcKYSSU6VjbkHSvxUIb5gasXZOUd_EJGRWIKBOsQM8JukWWYJYonamsFrVad9R5Xn0GsCI4CBq71O1S4/s400/Screen+Shot+2016-08-21+at+9.44.14+PM.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<ul style="background-color: white; box-sizing: border-box; color: #333333; font-family: "Gotham SSm A", "Gotham SSm B"; font-size: 14px;">
<li style="box-sizing: border-box;">10 x mini NeoPixels, each one can display any rainbow color</li>
<li style="box-sizing: border-box;">1 x Motion sensor (LIS3DH triple-axis accelerometer with tap detection, free-fall detection)</li>
<li style="box-sizing: border-box;">1 x Temperature sensor (thermistor)</li>
<li style="box-sizing: border-box;">1 x Light sensor (phototransistor)</li>
<li style="box-sizing: border-box;">1 x Sound sensor (MEMS microphone)</li>
<li style="box-sizing: border-box;">1 x Mini speaker (magnetic buzzer)</li>
<li style="box-sizing: border-box;">2 x Push buttons, left and right</li>
<li style="box-sizing: border-box;">1 x Slide switch</li>
<li style="box-sizing: border-box;">8 x alligator-clip friendly input/output pins<br style="box-sizing: border-box;" />Includes I2C, UART, and 4 pins that can do analog inputs/PWM output</li>
<li style="box-sizing: border-box;">All 8 pads can act as capacitive touch inputs</li>
<li style="box-sizing: border-box;">Green "ON" LED so you know its powered</li>
<li style="box-sizing: border-box;">Red "#13" LED for basic blinking</li>
<li style="box-sizing: border-box;">Reset button</li>
</ul>
<br />
No soldering required, just plug it in, setup and off you go with your prototype!<br />
<br />
I just had some time to play with it enough to set up the environment and get a few program going. Below are some useful links and screenshots. I was able to go thru the two sound tutorials:<br />
<br />
1. Get the latest <a href="https://www.arduino.cc/en/Main/Software" target="_blank">Arduino software</a>.<br />
2. Here is the <a href="https://learn.adafruit.com/introducing-circuit-playground/arduino-1-dot-6-x-ide" target="_blank">Adafruit Getting Started with Circuit Playground</a> instructions.<br />
3. <a href="https://learn.adafruit.com/circuit-playground-lesson-number-0/intro" target="_blank">Circuit Playground Intro</a><br />
4. Make sure you can see the serial port:<br />
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
MacBook-Air:~ echou$ ls /dev/cu*
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
/dev/cu.Bluetooth-Incoming-Port /dev/cu.usbmodem1411
</div>
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<br />
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
MacBook-Air:~ echou$ </div>
<br />
5. Setup screenshots:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheYl-le0xFY_JCfU1-Hb4N2b8YAQdg09jBat0LpOAZxY2w1luyiPrpJfIit29Sj3A33lBgFzLpjMiZX9QMbZ0kp5dJSxlqktby-EwsOCv5HbqWGY-mv_TuCdN8MV0ez1G6zyS6MngQV5g/s1600/Screen+Shot+2016-08-21+at+9.23.05+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="263" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheYl-le0xFY_JCfU1-Hb4N2b8YAQdg09jBat0LpOAZxY2w1luyiPrpJfIit29Sj3A33lBgFzLpjMiZX9QMbZ0kp5dJSxlqktby-EwsOCv5HbqWGY-mv_TuCdN8MV0ez1G6zyS6MngQV5g/s320/Screen+Shot+2016-08-21+at+9.23.05+PM.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyOq8Ia2d6US02KPX2X5pMnzCRokk0kAu1Njnr_isgFLAtiVBWuVp4m_4NOr5NMEYYfYAeLYIXYKpZhb3xwD1m0QAPoWF9kMe8RrCHX1f0aujsLvRK-aAwR_ApiC_3rpZWksOm0hd3Tbg/s1600/Screen+Shot+2016-08-21+at+9.36.52+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyOq8Ia2d6US02KPX2X5pMnzCRokk0kAu1Njnr_isgFLAtiVBWuVp4m_4NOr5NMEYYfYAeLYIXYKpZhb3xwD1m0QAPoWF9kMe8RrCHX1f0aujsLvRK-aAwR_ApiC_3rpZWksOm0hd3Tbg/s320/Screen+Shot+2016-08-21+at+9.36.52+PM.png" width="128" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQfYMxiph3663UVsUMTbirtuT9QP-2TXmanqpwF0tDGKzajzBtvpgRL7ZA5yySxbDlTHUA9cAIYwBu4ctRNjo0SPDueBKyoIieif2zmcigXH_CqclK1z0bYSCBTmQnEE_ex1sSVxpxIQo/s1600/Screen+Shot+2016-08-21+at+10.16.01+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="307" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQfYMxiph3663UVsUMTbirtuT9QP-2TXmanqpwF0tDGKzajzBtvpgRL7ZA5yySxbDlTHUA9cAIYwBu4ctRNjo0SPDueBKyoIieif2zmcigXH_CqclK1z0bYSCBTmQnEE_ex1sSVxpxIQo/s320/Screen+Shot+2016-08-21+at+10.16.01+PM.png" width="320" /></a></div>
<br />
<br />
6. I was able to get to these three tutorials:<br />
<br />
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
- Playground Speaker
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<a href="https://learn.adafruit.com/circuit-playground-music/using-the-circuit-playground-speaker" rev="en_rl_small">https://learn.adafruit.com/circuit-playground-music/using-the-circuit-playground-speaker</a></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
- Circuit Playground Library:
</div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<a href="https://github.com/adafruit/Adafruit_CircuitPlayground" rev="en_rl_small">https://github.com/adafruit/Adafruit_CircuitPlayground</a></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
- The sound of music:
</div>
<!--?xml version="1.0" encoding="UTF-8" standalone="no"?-->
<br />
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<a href="https://learn.adafruit.com/circuit-playground-music/the-sound-of-music" rev="en_rl_small">https://learn.adafruit.com/circuit-playground-music/the-sound-of-music</a></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
The only thing that I found for the sound of music tutorial is that extra library is needed besides pitches.h: </div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKntZZdfkIyuRqH3kDK4BSg0BJiovq1Gr5H9JldpY1Kjtv_T9GuyTaiFatPvu9xUBa9VCADG9sFAxdTuQs_JTE2e5yVRM6EjJKfbLHsSzKVK8qZ4p0TwMyhj_y8-5NqYD5w516FnLzi-s/s1600/Screen+Shot+2016-08-21+at+10.25.08+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKntZZdfkIyuRqH3kDK4BSg0BJiovq1Gr5H9JldpY1Kjtv_T9GuyTaiFatPvu9xUBa9VCADG9sFAxdTuQs_JTE2e5yVRM6EjJKfbLHsSzKVK8qZ4p0TwMyhj_y8-5NqYD5w516FnLzi-s/s320/Screen+Shot+2016-08-21+at+10.25.08+PM.png" width="320" /></a></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
I am really looking forward to tinker with it more, the idea really is to integrate this with Raspberry Pi and Python to make some interesting project! </div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
<br /></div>
<div style="font-family: 'Helvetica Neue'; font-size: 14px;">
Happy Coding! </div>
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com3tag:blogger.com,1999:blog-909746912855922547.post-47975967046145775562016-09-13T08:12:00.001-07:002016-09-13T08:12:56.507-07:00AWS Internet of Things ButtonI received my <a href="https://aws.amazon.com/iot/button/" target="_blank">AWS IoT Button</a> a few days ago. This is a programmable button based on the Amazon Dash Button, you know, those little buttons that allows you to order stuff from Amazon by just pressing on it. What is different about this button is the programmability and getting you introduced to the AWS IoT platform with sample code and wizard workflow.<br />
<br />
The 'Getting Started' on this <a href="https://aws.amazon.com/iot/button/" target="_blank">page</a> is a good introduction, since the purpose of the button is to allow you to experience the end user experience when they received your future IoT device, I dont repeat or rob you of the experience here. What I want to show would be the sample output of each of the step for me so you can compare with your own if you run into something different.<br />
<br />
The whole process took about 1 hour for me, it would have been quicker if I had not deviate from the wizard of trying to see if there were Python Lambda code or if if I had not change the IoT permission in the Wizard.<br />
<br />
Here are some picture of the steps:<br />
<br />
1. Picture of the IoT button when it arrived:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZZant7N15lNZCAUqO4f3sP0P9wWlOD8yF_aYW5-8GiN23tMl4B_jjXpZ-knZ_Irn28odGK8N0HOvhwL8HSKSR1s25rE4lHiRzror2ZG6J4BDkMDAnCdbVdd8gFYEwcMSJRRqVwPlN49s/s1600/0_button_pic_1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZZant7N15lNZCAUqO4f3sP0P9wWlOD8yF_aYW5-8GiN23tMl4B_jjXpZ-knZ_Irn28odGK8N0HOvhwL8HSKSR1s25rE4lHiRzror2ZG6J4BDkMDAnCdbVdd8gFYEwcMSJRRqVwPlN49s/s320/0_button_pic_1.png" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizcaer5estO3De23Ee1LeBeJO6YVufTs4hPYPzAWsiDExRgwLJ3aK4Xs2o91o76-vz8rE0e9LSbW3wBXlXFdxj3au14D4ChXFozzUX1p7pdlbtmsWGDbXbUG7H9d-CYjB2bh0SG85kKtM/s1600/0_button_pic_2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizcaer5estO3De23Ee1LeBeJO6YVufTs4hPYPzAWsiDExRgwLJ3aK4Xs2o91o76-vz8rE0e9LSbW3wBXlXFdxj3au14D4ChXFozzUX1p7pdlbtmsWGDbXbUG7H9d-CYjB2bh0SG85kKtM/s320/0_button_pic_2.png" width="240" /></a></div>
<br />
<br />
2. Overall workflow of what we will go thru<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaY-77HWgMfCLSuug4Q9R8lfZoiRU3x6f2M2fRrs_PgYRyVsBLOR34edl6Zer9-703dAVEkIDobrzSd2U2Y3OvlHDZyodREnaFExEA2GETqc3hPeEakdCcEO4BUbmm2b6HVBaElmihsb0/s1600/1_iot_button_overall.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaY-77HWgMfCLSuug4Q9R8lfZoiRU3x6f2M2fRrs_PgYRyVsBLOR34edl6Zer9-703dAVEkIDobrzSd2U2Y3OvlHDZyodREnaFExEA2GETqc3hPeEakdCcEO4BUbmm2b6HVBaElmihsb0/s320/1_iot_button_overall.png" width="320" /></a></div>
<br />
<br />
3. Choosing the IoT button from the AWS IoT portal<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjruTvHXxbCJNx0KNVXHb87jX-filb2DVaBvEajb1z9FX_Bqy1fQ98RCaSNEqqDhDndeEmRZCm3SATxyV-Oy-hZliteBEKk0tD77hQobIHyS6FJ80fD7vPQvTVc8HxlLnd91s8v62fmI_4/s1600/2_IOT_Button_Portal.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="43" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjruTvHXxbCJNx0KNVXHb87jX-filb2DVaBvEajb1z9FX_Bqy1fQ98RCaSNEqqDhDndeEmRZCm3SATxyV-Oy-hZliteBEKk0tD77hQobIHyS6FJ80fD7vPQvTVc8HxlLnd91s8v62fmI_4/s400/2_IOT_Button_Portal.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
4. Configure the IoT trigger to go to Lambda</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqRmD77rrvnyR8jGRutOUieo5YdTpMJrKyyGPIC99sOln7nv0x7ltSy_vBnGv9lI7CXJuwS4GuVzvm-CFrmxsM0QCcshqab6Ep_LN2iFlqMvEBjtImXxuhn8Y-Blw_EmH2x3bZCyC7dns/s1600/3_configure_trigger.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="182" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqRmD77rrvnyR8jGRutOUieo5YdTpMJrKyyGPIC99sOln7nv0x7ltSy_vBnGv9lI7CXJuwS4GuVzvm-CFrmxsM0QCcshqab6Ep_LN2iFlqMvEBjtImXxuhn8Y-Blw_EmH2x3bZCyC7dns/s320/3_configure_trigger.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
5. The page will automatically generate the cert and private key, download them and set up the button by following the instruction on the page</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijyY7Cq4kRb2pnvyZDjkJAcC-np1CMJ_9TAJiXlBKqRn1EGyTUcWk2CnWI1O6_JozeoW9u9b0oxlVmL8-ftJTnxSq_VQZx4aA6ZS6uOhqnJq3SJ3kLzvfVuDGV36C_lUgXAwE2uASuUtU/s1600/4_1_Device_Conifgured.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijyY7Cq4kRb2pnvyZDjkJAcC-np1CMJ_9TAJiXlBKqRn1EGyTUcWk2CnWI1O6_JozeoW9u9b0oxlVmL8-ftJTnxSq_VQZx4aA6ZS6uOhqnJq3SJ3kLzvfVuDGV36C_lUgXAwE2uASuUtU/s320/4_1_Device_Conifgured.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjob4vNTig74h0915zaoX7Rp9T_hE3h8hTKT_ZWjybdndlfGJC23mFqfGKpvU-vzwMJo8M10ryCKIJNdKOrMw1VUQhaPhvZWazb4M58VbieRGz1Cn4DinJ3KAXorsUTjIc7aSPhqykM-NA/s1600/4_2_Device_Configured.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="103" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjob4vNTig74h0915zaoX7Rp9T_hE3h8hTKT_ZWjybdndlfGJC23mFqfGKpvU-vzwMJo8M10ryCKIJNdKOrMw1VUQhaPhvZWazb4M58VbieRGz1Cn4DinJ3KAXorsUTjIc7aSPhqykM-NA/s320/4_2_Device_Configured.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
6. Lambda function is now complete</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFGXFNL7YgyvN_yJAhRfw2U6M4f7aTRLf9snqtt6lHjDw7JVt6peL5NE87-DMEx9adGsADnZWdJ2n9cfB6tRiju0wa8QfbVcdGlePBrNrdXztJsUbToMA6WX3ymIaJWarCWKJyVTFNSSw/s1600/5_Finished_Lambda_Function.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="122" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFGXFNL7YgyvN_yJAhRfw2U6M4f7aTRLf9snqtt6lHjDw7JVt6peL5NE87-DMEx9adGsADnZWdJ2n9cfB6tRiju0wa8QfbVcdGlePBrNrdXztJsUbToMA6WX3ymIaJWarCWKJyVTFNSSw/s400/5_Finished_Lambda_Function.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
7. You can now press the button, which will blink blue while operating and green when it is done. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu6VmDyVcY1VxRvxdMl771x528V9eLKE3HJ0kSikqF9z7PziQBRt3IWLvDaOf1pjfqlQJ7cSrz9-mNjy7kv9FGpRF6cvVeHtfEKJWukzWeZEUbPME1IMIk2KkTODO3pHqSAb75d-yiQcc/s1600/5_1_Botton_Blue.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiu6VmDyVcY1VxRvxdMl771x528V9eLKE3HJ0kSikqF9z7PziQBRt3IWLvDaOf1pjfqlQJ7cSrz9-mNjy7kv9FGpRF6cvVeHtfEKJWukzWeZEUbPME1IMIk2KkTODO3pHqSAb75d-yiQcc/s320/5_1_Botton_Blue.JPG" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8Asxs8HkHJiTVc5V_f-75wlW_psFtj79F5v0lIDQGdtKYJfdhsToMPNs-wePbkrHEEq-Uc690uTPrW54LWzQO8vsrXevf-JQzCbhQyCAWArZIF5CN4PknRbjZdW1pB_YQ58ZkxCMwxPc/s1600/5_1_Botton_Green.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh8Asxs8HkHJiTVc5V_f-75wlW_psFtj79F5v0lIDQGdtKYJfdhsToMPNs-wePbkrHEEq-Uc690uTPrW54LWzQO8vsrXevf-JQzCbhQyCAWArZIF5CN4PknRbjZdW1pB_YQ58ZkxCMwxPc/s320/5_1_Botton_Green.JPG" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
8. Here are some screenshots of the email sent, subscription confirmation page, and following emails. Notice in the subject line there is also the type of button push, single or double click.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitsxhE4970FHyLzcdp8xFq8iL9rze-l8IWxCIFPOt3RUUg5Z8oYLwEGlKRFcvmzywcFz64eXeiAqpeUDAoAzVIMLbtRMj4OlYWwXOtkKcNfQ4zcoJtOAUjIMUXqhpFzpl5Xm6fnaY-Dlg/s1600/6_Subscription_Email.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="80" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitsxhE4970FHyLzcdp8xFq8iL9rze-l8IWxCIFPOt3RUUg5Z8oYLwEGlKRFcvmzywcFz64eXeiAqpeUDAoAzVIMLbtRMj4OlYWwXOtkKcNfQ4zcoJtOAUjIMUXqhpFzpl5Xm6fnaY-Dlg/s320/6_Subscription_Email.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq8kt4ZQ7NniS3LED3d5YSp0Mg7B8bPaYkwpqkAVTWOCNx8-DAe1OBzV32t4Sg2REHWOewQJb6NssxdfLyls0E-d8bXYvWMrOfBwdqtGqmzWeNlkgybx9seW_J307uPUGavo-L7AW4WxA/s1600/6_1_Subscription_Confirmation.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="161" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiq8kt4ZQ7NniS3LED3d5YSp0Mg7B8bPaYkwpqkAVTWOCNx8-DAe1OBzV32t4Sg2REHWOewQJb6NssxdfLyls0E-d8bXYvWMrOfBwdqtGqmzWeNlkgybx9seW_J307uPUGavo-L7AW4WxA/s320/6_1_Subscription_Confirmation.png" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI3jriN0kOdcJ9IHP2o0_BgZFVSb2NJcJncv3gk_ckn-yhp4jcy75TfqYJr5jR0-eOefXn6SeJ5hkr_IEG0oeQzfPrwGkWjUW2UF4lAxrbDyzpUUNHeanQr7AVi7jNhyphenhyphendW6u1IWE7SL4g/s1600/7_Later_Emails.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="87" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgI3jriN0kOdcJ9IHP2o0_BgZFVSb2NJcJncv3gk_ckn-yhp4jcy75TfqYJr5jR0-eOefXn6SeJ5hkr_IEG0oeQzfPrwGkWjUW2UF4lAxrbDyzpUUNHeanQr7AVi7jNhyphenhyphendW6u1IWE7SL4g/s320/7_Later_Emails.png" width="320" /></a></div>
<br />
<br />
This was really fun. I am thinking of other use. The only thing is the sample code is in Node.js, so I need to spend some time looking it over before I can start think of other use cases. At some point I should convert that to Python. :)<br />
<br />
Happy coding!<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com3tag:blogger.com,1999:blog-909746912855922547.post-12930506113484314712016-09-06T11:50:00.000-07:002016-09-06T11:59:42.753-07:00Make a Twitter Bot in Python and AWS LambdaI followed this excellent tutorial from <a href="http://joelgrus.com/2015/12/30/polyglot-twitter-bot-part-3-python-27-aws-lambda/" target="_blank">Joel Grus</a> on how to make a Twitter Bot. If you have followed some of my post before, <a href="http://blog.pythonicneteng.com/2013/12/project-mining-social-web-2nd-edition.html" target="_blank">Project Mining Social Web 2nd Edition</a> or <a href="http://blog.pythonicneteng.com/2012/09/python-with-json.html" target="_blank">Python with JSon</a>, you know I have had a little bit of experience using the Twitter API.<br />
<br />
Here is a screenshot of the Twitter Bot:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghviM1PbE5GNV342-Vvoh6PdSm9QSkzJ4PkWUGFNq9PlDXLMxroU9dF8AbYUg-dfF8AlDeE-ey9CChiUjFdiCAkKWj-kbWgzLKJYWs9CZTHKlrHZr7be0-P3bAk3b0rT7eFX3Yxv_meFQ/s1600/Screen+Shot+2016-09-06+at+11.58.22+AM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="258" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghviM1PbE5GNV342-Vvoh6PdSm9QSkzJ4PkWUGFNq9PlDXLMxroU9dF8AbYUg-dfF8AlDeE-ey9CChiUjFdiCAkKWj-kbWgzLKJYWs9CZTHKlrHZr7be0-P3bAk3b0rT7eFX3Yxv_meFQ/s400/Screen+Shot+2016-09-06+at+11.58.22+AM.png" width="400" /></a></div>
<br />
<br />
What is different this time, is that I wish to use AWS Lambda as the backend. I want to know what is required and what the workflow was. I wont repeat the steps Joel listed out in his tutorial, just some of the things I found out:<br />
<br />
1. Seems that AWS Lambda wants the main file to be lambda_function.py and the main function to be lambda_handler(event, context).<br />
<br />
2. The scheduling trigger is now "CloudWatch Events - Schedule" instead of just schedule.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN38xgUeU0rr8lJrvwlYIZX-jrk1O7lGyTrF4Xz4180Ahc1wY37kIq1oMTaU4G9u6sVhmAnrQb4pnD5DdUrbPRMkVwumBskyUZFyPM-7Cq7EMwc1hSo9FcxkUBmmEHE1U8PZ0b2ELRlL4/s1600/temp1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgN38xgUeU0rr8lJrvwlYIZX-jrk1O7lGyTrF4Xz4180Ahc1wY37kIq1oMTaU4G9u6sVhmAnrQb4pnD5DdUrbPRMkVwumBskyUZFyPM-7Cq7EMwc1hSo9FcxkUBmmEHE1U8PZ0b2ELRlL4/s400/temp1.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
3. I learned this from a friend that to always immediately put the credential file in .gitignore to avoid accidentally checking it in on GitHub.<br />
<blockquote class="tr_bq">
<br />
echou$ cat .gitignore<br />
*.pyc<br />
credentials.json</blockquote>
<br />
I am now the proud owner of a Twitter Bot that searches for Cisco layoff news and retweet them. On this date of Aug. 19, 2016 that was the big news of the week.<br />
<br />
<a href="https://twitter.com/Network4_Nerds" target="_blank">https://twitter.com/Network4_Nerds</a><br />
<br />
echou$<br />
<br />
Here is what my code ended up as:<br />
<br />
<blockquote class="tr_bq">
from __future__ import print_function<br />
from twython import Twython<br />
from twython.exceptions import TwythonError<br />
import re<br />
import json, pprint<br />
with open('credentials.json') as f:<br />
credentials = json.loads(f.read())<br />
client = Twython(credentials["consumer_key"],<br />
credentials["consumer_secret"],<br />
credentials["access_token_key"],<br />
credentials["access_token_secret"])<br />
query = "cisco layoffs -filters:retweets"<br />
rgx = r"cisco"<br />
def lambda_handler(event, context):<br />
results = client.search(q=query)<br />
for tweet in results["statuses"]:<br />
text = tweet["text"]<br />
# re.search matches anywhere in the string; re.I means case-insensitive<br />
if re.search(rgx, text, re.I):<br />
print(tweet["text"])<br />
# client.retweet will raise an error if we try to retweet a tweet<br />
# that we've already retweeted. to avoid having to keep track, we<br />
# just use a try/except block<br />
try:<br />
client.retweet(id=tweet["id"])<br />
except TwythonError as e:<br />
print(e)<br />
<br />
results = client.search(q=query)<br />
pprint.pprint(results)</blockquote>
<br />
<br />
Happy Coding!<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com141tag:blogger.com,1999:blog-909746912855922547.post-45335422980607427882016-08-23T07:58:00.001-07:002016-08-23T07:58:26.909-07:00Curlify Your Python Requests ObjectsI love things that are simple and useful. Egor's <a href="https://github.com/oeegor/curlify" target="_blank">Curlify</a> Python module is one of these gems I saw this morning.<br />
<br />
I already have a Python script that demonstrate A10 Network's AXAPI using the Requests package:<br />
<br />
<a href="https://github.com/a10networks/tps-scripts/blob/master/axapi_example.py" target="_blank">https://github.com/a10networks/tps-scripts/blob/master/axapi_example.py</a><br />
<br />
With this package, I changed exactly one line of code wherever I wanted to give an curl example of the same operation.<br />
<br />
For example, after importing the curlify file, instead of printing out r.content in line 23, I just print out curlify.to_curl(r.reqeust) and boom, I have a curl command I can pass to people! How cool is that?<br />
<blockquote class="tr_bq">
<br />
7 <span style="background-color: yellow;">import requests, json, curlify</span><br />
17 # Acquire athorization token<br />
18 auth_headers = {'content-type': 'application/json'}<br />
19 auth_payload = {"credentials": {"username": "admin", "password": "a10"}}<br />
20 auth_endpoint = '/axapi/v3/auth'<br />
21 url = base_url + auth_endpoint<br />
22 r = requests.post(url, data=json.dumps(auth_payload), headers=auth_headers, verify=Fa lse)<br />
<span style="background-color: yellow;"> 23 print(curlify.to_curl(r.request))</span></blockquote>
<br />
Of course, you get the most out of it if you use Requests already (who isnt?) and you can just write it in Requests. When somebody else wants a simpler operation, say using just curl, that you can just easily dish it out to them in less than 5 minutes.<br />
<br />
This is my final output from the same Python file above:<br />
<a href="https://github.com/a10networks/tps-scripts/blob/master/axapi_curl_example.txt" target="_blank">https://github.com/a10networks/tps-scripts/blob/master/axapi_curl_example.txt</a><br />
<br />
The only different from the plain output is I added a '-k' to the curl operation because I have a self-signed certificate on the A10 Thunder TPS.<br />
<br />
Nice tool, nice output, no sweat. My type of thing. :)<br />
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com6tag:blogger.com,1999:blog-909746912855922547.post-86499310834134831842016-08-15T11:50:00.003-07:002016-08-15T11:50:52.074-07:00How-To Enable Bash on Windows 10 in 5 StepsI don't know about you, but it really feels like a new day in technology when I see a bash shell running naively on Windows!<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFLmylNw4HUabqtFwOjtDAy-sGOOHd-5Yl7lkJCdeaHR2Jq3iwiJhhbNUsTSPGIfCBpbClBYsDMjfjLBSEKpPvRQByWtHt5FW9y1dCsaCkYK4LumWr5LXFMOkAoY7kTHqK-9Emyyx6pxg/s1600/final_bash_1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFLmylNw4HUabqtFwOjtDAy-sGOOHd-5Yl7lkJCdeaHR2Jq3iwiJhhbNUsTSPGIfCBpbClBYsDMjfjLBSEKpPvRQByWtHt5FW9y1dCsaCkYK4LumWr5LXFMOkAoY7kTHqK-9Emyyx6pxg/s320/final_bash_1.PNG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8SDwAw4r4VmCugQMdGs-7V2aqr-hZk6HWSlFNAjTUl5l49hn-jLLUtrnWGpBmhUMSln7Tvje-ezb28zkMTsrpsDrQezfs6-At_ug73XcM1rQl50Exe95xrMgepBj-wtWJZN2cP4AkV3s/s1600/final_bash_2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8SDwAw4r4VmCugQMdGs-7V2aqr-hZk6HWSlFNAjTUl5l49hn-jLLUtrnWGpBmhUMSln7Tvje-ezb28zkMTsrpsDrQezfs6-At_ug73XcM1rQl50Exe95xrMgepBj-wtWJZN2cP4AkV3s/s320/final_bash_2.PNG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP94sVJ7SqDOmbb1qBfH1iZwFlgccsTkwExoh_1g6ykUqAuuPy_n2V1hUI2Q7agvMED_e2q1SkdiQm3oAI_y4r8kcgTbSVXELUn9OEBB8l4jEb_8-GoHEwvQ7M2ktk03Hd8uLtPvFR9Ts/s1600/final_bash_3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP94sVJ7SqDOmbb1qBfH1iZwFlgccsTkwExoh_1g6ykUqAuuPy_n2V1hUI2Q7agvMED_e2q1SkdiQm3oAI_y4r8kcgTbSVXELUn9OEBB8l4jEb_8-GoHEwvQ7M2ktk03Hd8uLtPvFR9Ts/s320/final_bash_3.PNG" width="320" /></a></div>
<br />
<br />
Windows 10 <a href="https://blogs.windows.com/windowsexperience/2016/08/02/how-to-get-the-windows-10-anniversary-update/" target="_blank">Anniversary Update</a> has been out for almost 2 weeks now (update 1607), and by now it is relatively stable. Any major flaw should have been discovered by now, note that it is still update-at-your-own-risk kind of a thing, but I have decided to go for it since I just want to see Bash shell running on Windows natively.<br />
<br />
Here are the steps I took (from<a href="http://www.pcworld.com/article/3106463/windows/how-to-get-bash-on-windows-10-with-the-anniversary-update.html" target="_blank"> PCWorld article</a>):<br />
<br />
1. Check for Windows Update. If the updater does not automatically prompt for update 1607, click on 'Learn More' on the same page and follow the link to get the executable for the update. That is what I had to do:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAPmK1mSzjUKe87cLU18N-TcT3qnJoOhcWKy8eaOgJhvWjtIn5OAtWGVg0pkJ9PqztHc8DMKY7_yZz5YmjobAEAXZYOV2HU6etPQHnK0uOXZlBi2az50AwtrYSJ69zykheKzncuP1lpRY/s1600/0_WIndows10_Anniversary_Update.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="203" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAPmK1mSzjUKe87cLU18N-TcT3qnJoOhcWKy8eaOgJhvWjtIn5OAtWGVg0pkJ9PqztHc8DMKY7_yZz5YmjobAEAXZYOV2HU6etPQHnK0uOXZlBi2az50AwtrYSJ69zykheKzncuP1lpRY/s320/0_WIndows10_Anniversary_Update.PNG" width="320" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikBZS15xwVb_rI-87rV96MlYggUDWiK5ETHKtnt4HXDZhhB6VbDTQGFHEJgeM6n8PmEFlUxnLrzOL5uKl93TRjja_82cBwKkui2BQFYiO-jO3bU5_kyw9iMKsNpdqS4pcB2vfCZEmPNZo/s1600/0_1_WIndows10_Anniversary_Update.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="222" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEikBZS15xwVb_rI-87rV96MlYggUDWiK5ETHKtnt4HXDZhhB6VbDTQGFHEJgeM6n8PmEFlUxnLrzOL5uKl93TRjja_82cBwKkui2BQFYiO-jO3bU5_kyw9iMKsNpdqS4pcB2vfCZEmPNZo/s320/0_1_WIndows10_Anniversary_Update.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
2. Enable Developer Mode in Settings:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggWQuzjvmZ-Nzb7l93bNBeFQxsZJqpHfFHmfnotrBrbSLR6rUXyhRM6uYO2HI2JWB6EySx2A8oqKs2UdiHvVpB_gzHcehSewOazWd9uP8WKRYjUSxF5hirIEJ0J9oP-RDPaM5mfFyXeaU/s1600/1_Settings.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggWQuzjvmZ-Nzb7l93bNBeFQxsZJqpHfFHmfnotrBrbSLR6rUXyhRM6uYO2HI2JWB6EySx2A8oqKs2UdiHvVpB_gzHcehSewOazWd9uP8WKRYjUSxF5hirIEJ0J9oP-RDPaM5mfFyXeaU/s320/1_Settings.PNG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuWPyt6_D2UFXuhX0tgsVJ9Z51LPubS8AkIAjjZjcMzsbJoUfouFrNk5SUIT8hQ3FWCXMiyQJ5sswHOlPZiSQ9mY7THocPEqUGPLaWKenqsLToPlbDAeZH_axrMAs8aXab9nO3O3N6RKs/s1600/2_Developers.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="287" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuWPyt6_D2UFXuhX0tgsVJ9Z51LPubS8AkIAjjZjcMzsbJoUfouFrNk5SUIT8hQ3FWCXMiyQJ5sswHOlPZiSQ9mY7THocPEqUGPLaWKenqsLToPlbDAeZH_axrMAs8aXab9nO3O3N6RKs/s320/2_Developers.PNG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE830j2pl08YDS94oGaM5XMOv51SpkIvAgvQMkYlV_IUymVRIzn3Hx3JrWLOPfVljivjnAb_E9NLm_mgLmI07rotlPV_1Nanpv8Yk6yGJ81ibATW1Ut51jawuthlVr-V7sSOpPWm8JJ34/s1600/3_For_Developers.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="279" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgE830j2pl08YDS94oGaM5XMOv51SpkIvAgvQMkYlV_IUymVRIzn3Hx3JrWLOPfVljivjnAb_E9NLm_mgLmI07rotlPV_1Nanpv8Yk6yGJ81ibATW1Ut51jawuthlVr-V7sSOpPWm8JJ34/s320/3_For_Developers.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<br />
<br />
4. In control panel, enable Windows Bash Shell feature:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYmA01HEU70MuqJdP4uvGAKVDzZ02uMMs6A48BTiMaKM00TJPoPnx2di32AHnuHk7lmJVn6WOf4Bx6MqSsE9OVdPTLvhU6stqjnivP4NaLerCsbmdhGClnbjbE2DMrV_wPJzCvv9yyUho/s1600/4_Control_Panel.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYmA01HEU70MuqJdP4uvGAKVDzZ02uMMs6A48BTiMaKM00TJPoPnx2di32AHnuHk7lmJVn6WOf4Bx6MqSsE9OVdPTLvhU6stqjnivP4NaLerCsbmdhGClnbjbE2DMrV_wPJzCvv9yyUho/s320/4_Control_Panel.PNG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQQmEd7DeBJjFO5R7XeIf0ZOFf59_RGSbqRatcvU_STx2XoV2ljPE5L3HUkj9vCMeb70AaluXaSJkIxMpLzWHeC9vCz633xJLoCYGqLuCOV3VR_LJhLoDGzbAu_1AIv_RfsGILq88nZm4/s1600/5_Programes_Trun_Features.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="194" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQQmEd7DeBJjFO5R7XeIf0ZOFf59_RGSbqRatcvU_STx2XoV2ljPE5L3HUkj9vCMeb70AaluXaSJkIxMpLzWHeC9vCz633xJLoCYGqLuCOV3VR_LJhLoDGzbAu_1AIv_RfsGILq88nZm4/s320/5_Programes_Trun_Features.PNG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqA92YTYig-Uf7qWysFbD_s0d1DE6_TuoTGz-mDckDUd3zzl_HswpDUe0FReM8AHURAVZLwOaa9qeySVMdxji5mNC8tLDBikKzYS9RuB5I3U8xcxqtCAKtRKg2I1a_l6lvPQR00HspzA4/s1600/6_Windows_Subsystem_for_Linux.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="284" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqA92YTYig-Uf7qWysFbD_s0d1DE6_TuoTGz-mDckDUd3zzl_HswpDUe0FReM8AHURAVZLwOaa9qeySVMdxji5mNC8tLDBikKzYS9RuB5I3U8xcxqtCAKtRKg2I1a_l6lvPQR00HspzA4/s320/6_Windows_Subsystem_for_Linux.PNG" width="320" /></a></div>
<br />
<br />
5. Reboot, search for Bash and it will prompt you for the rest of the installation. Of course the first hing I do is to test out Python2 and Python3.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVR6bPWEP-KI-iBQCF_6C4vKKwHrlFdQduwMG-FnK9bqH9aVWVTrfE5zm3ktj-o5v2VNHI5Zbc1l-WZGktiWBP8-aiZePX_d3Xml5upxyudFZ_8k6Pp4ze06Apg2sr96-uTrnT63-acpk/s1600/final_bash_1.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVR6bPWEP-KI-iBQCF_6C4vKKwHrlFdQduwMG-FnK9bqH9aVWVTrfE5zm3ktj-o5v2VNHI5Zbc1l-WZGktiWBP8-aiZePX_d3Xml5upxyudFZ_8k6Pp4ze06Apg2sr96-uTrnT63-acpk/s320/final_bash_1.PNG" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyMcJ2UYDD32lK2sv3Rb8ZZ2PONS7UXmBILkTEgpMAnw1Jz3lwY9SDTgYM5IAaoq7CWTCI_4oMzqI5k_pnR1RdkUBgLINjmraP_BGPDZeY8dRbdoUG22gg0N4fYnlDpJpcecOZ_cJuqnk/s1600/final_bash_2.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="172" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyMcJ2UYDD32lK2sv3Rb8ZZ2PONS7UXmBILkTEgpMAnw1Jz3lwY9SDTgYM5IAaoq7CWTCI_4oMzqI5k_pnR1RdkUBgLINjmraP_BGPDZeY8dRbdoUG22gg0N4fYnlDpJpcecOZ_cJuqnk/s320/final_bash_2.PNG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi0sVoKyUFs-QTQUmAvWUGq3ThQgXKJLmaA3y_Mq60lS6Dk_OdCdZs7sIgUg-lbQa5ijUwACUmqh9xftgChSXjnYmPLiOaZjwVoGplpWdHF-NfEanH0jZ3SyXR1bm9qhwRjPqYjXSrv60/s1600/final_bash_3.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="186" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhi0sVoKyUFs-QTQUmAvWUGq3ThQgXKJLmaA3y_Mq60lS6Dk_OdCdZs7sIgUg-lbQa5ijUwACUmqh9xftgChSXjnYmPLiOaZjwVoGplpWdHF-NfEanH0jZ3SyXR1bm9qhwRjPqYjXSrv60/s320/final_bash_3.PNG" width="320" /></a></div>
<br />
<br />
<br />
Leave me a comment or question below, let me know what you think! Happy Coding!<br />
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com1tag:blogger.com,1999:blog-909746912855922547.post-51843376445653403582016-08-10T08:23:00.002-07:002016-09-13T06:56:08.290-07:00How to Mine Twitter in Under One HourThere are a number of books discussing using Python to mine the social web. After trying out Facebook, LinkedIn, and Twitter API's, it is my believe that Twitter provides the most friendly workflow for anybody to get started. For the past two days I have been working on a project where mining the Twitter feed was a part of the overall process. Here I want to briefly share some of the steps I took using Python. I believe the whole process shouldn't take you more than 1 hour.<br />
<br />
1. Determine the Twitter module to use.<br />
<br />
There were a number of Python Twitter modules, a simple search turns up two popular modules: <a href="https://github.com/bear/python-twitter/blob/master/README.rst" target="_blank">Python-Twitter</a> and <a href="https://github.com/tweepy/tweepy" target="_blank">Tweepy</a>. Since I had the chance to listen to Elizabeth Uselton's <a href="https://www.youtube.com/watch?v=iU9FM9qnEjk" target="_blank">PyCon 2016 Talk</a> a few weeks back at a local Python meetup, I decided to use the same library, which was python-twitter.<br />
<br />
[Update 9/5/2016] Make sure you use 'python-twitter' package, i.e. <b>pip install python-twitter</b>. Not pip install twitter.<br />
<br />
2. Register a developer account at <a href="https://dev.twitter.com/" target="_blank">https://dev.twitter.com/</a> for documentation and create an app via <a href="https://apps.twitter.com/" target="_blank">https://apps.twitter.com/</a> to get all the keys for your program.<br />
<br />
3. Follow the instruction <a href="https://github.com/bear/python-twitter/blob/master/README.rst" target="_blank">here</a> to pip install the module and give it a spin. Below is an example using the Python REPL (off my Raspberry Pi 3, mind you :)).<br />
<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
pi@raspberrypi:~/Alexa $ python</blockquote>
<blockquote class="tr_bq">
Python 2.7.9 (default, Mar 8 2015, 00:52:26)</blockquote>
<blockquote class="tr_bq">
[GCC 4.9.2] on linux2</blockquote>
<blockquote class="tr_bq">
Type "help", "copyright", "credits" or "license" for more information.</blockquote>
<blockquote class="tr_bq">
>>> import twitter, pprint, json</blockquote>
<blockquote class="tr_bq">
>>> api = twitter.Api(consumer_key="<you get this from the twitter app>",</blockquote>
<blockquote class="tr_bq">
... consumer_secret="<you get this from the twitter app>",</blockquote>
<blockquote class="tr_bq">
... access_token_key="<you get this from the twitter app>",</blockquote>
<blockquote class="tr_bq">
... access_token_secret="<you get this from the twitter app>")</blockquote>
<blockquote class="tr_bq">
>>> print(api.VerifyCredentials())</blockquote>
<blockquote class="tr_bq">
{"created_at": "Thu Dec 18 17:35:54 +0000 2008", "description": "Network Automation Nerds", "favourites_count": 16, "followers_count": 58, "friends_count": 225, "name": "ericchou", "profile_background_color": <skip>}</blockquote>
<blockquote class="tr_bq">
>>></blockquote>
</blockquote>
<br />
4. Cool, let's do some search. Since the Olympics is going on, I bet that is a hot topic:<br />
<br />
<blockquote class="tr_bq">
<blockquote class="tr_bq">
>>> searchResult = api.GetSearch(term="Olympics", lang='en', result_type='recent', count=5, max_id='')</blockquote>
<blockquote class="tr_bq">
>>> pprint.pprint(searchResult)</blockquote>
<blockquote class="tr_bq">
[Status(ID=763393850215960577, ScreenName=Brezshun, Created=Wed Aug 10 15:17:31 +0000 2016, Text=u'RT @DragonflyJonez: Even Hitler sent Jesse Owens a nondescript, mass mailing thank you card for participating in the Olympics. FDR never ev\u2026'),</blockquote>
<blockquote class="tr_bq">
Status(ID=763393849964294144, ScreenName=JeremyMcDoniell, Created=Wed Aug 10 15:17:31 +0000 2016, Text=u'RT @br_uk: Michael Phelps has won more men\u2019s swimming #Gold medals than all but two countries in the history of the #Olympics \U0001f64c https://t.c\u2026'),</blockquote>
<blockquote class="tr_bq">
Status(ID=763393849930584065, ScreenName=alyajaafar, Created=Wed Aug 10 15:17:31 +0000 2016, Text=u'RT @BBAnimaIVids: Kitten Summer Olympics \U0001f63a https://t.co/EGUWnOrGsX'),</blockquote>
<blockquote class="tr_bq">
Status(ID=763393849536372736, ScreenName=ilhamfachrul, Created=Wed Aug 10 15:17:31 +0000 2016, Text=u'RT @BBCSport: Watch live @BBCOne (UK only) and the @BBCSport website.\n\nhttps://t.co/b87rfBg0qt #RioOlympics2016 https://t.co/767BAdAmza'),</blockquote>
<blockquote class="tr_bq">
Status(ID=763393848747888640, ScreenName=JustLandlords, Created=Wed Aug 10 15:17:31 +0000 2016, Text=u'RT @NewsLandlords: Have the London Olympics had a long-lasting effect on the property market? https://t.co/QolbtKou6a #London #property htt\u2026')]</blockquote>
<blockquote class="tr_bq">
>>></blockquote>
</blockquote>
<br />
5. There you have it, quick and simple. Here is the official <a href="https://dev.twitter.com/overview/documentation" target="_blank">API Doc from Twitter</a>.<br />
<br />
Happy Coding! <br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com3tag:blogger.com,1999:blog-909746912855922547.post-49419160191416166522016-08-02T12:56:00.001-07:002016-08-02T12:56:37.608-07:00Amazon Alexa - Hello World AppOk, so if you followed by last post, you know I was trying to get more familiar with Amazon Alexa / Echo but found Lambda to be too difficult. Did I mention Amazon is throwing all kinds of resources behind their newest toy? Oh yeah, there was a free Alexa training from Big Nerd Ranch from an ad that pushed directly in my face on Facebook. For those who does not know, Big Nerd Ranch authored some of the best selling training books on iOS and Android. So I signed up.<br />
<br />
Truth be told, out of respect to their IP, I should not post their content here. But I can say that they helped me understand some of the basic building blocks of building a Skill. You can probably search around online and get the same material for free, and I have a feeling they will post the lessons online at some point.<br />
<br />
The biggest surprise for me was that you should build the Lambda function and the Alexa Skill at the same time, also you don't need to publish either in order to start testing. Here are two screenshots and screencast of the hello world app I build. You can see that neither was in a 'published' state but they were happily interacting with each other and my EchoSim.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjelBp4V6jmNEXOQWEV9k_K6IVVvJ-4HLEr6SWTRapi53KEO_rx1cnyhsqDh1YjjZ-yI4AEXKYwHZY1CZoe7dI_5eMHghubkt-2NRM-gfZ6UoqbdcN_g_ldwx3LoupyB-BmvUdZwtxjPYQ/s1600/Screen+Shot+2016-07-20+at+9.43.26+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="221" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjelBp4V6jmNEXOQWEV9k_K6IVVvJ-4HLEr6SWTRapi53KEO_rx1cnyhsqDh1YjjZ-yI4AEXKYwHZY1CZoe7dI_5eMHghubkt-2NRM-gfZ6UoqbdcN_g_ldwx3LoupyB-BmvUdZwtxjPYQ/s320/Screen+Shot+2016-07-20+at+9.43.26+PM.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSs0wa8SotfHPFnTrzn3brI3_MzfdMY_Y8p51gqvVp4F8V3oohwsp7dLlcA864G0uNM31d0Pfjh6hFkDZ4xPh4BnebzVdYB_ixo44hCA0I8A465kaUiQYi5up6u3hsF-wLVXGf7ehpyhk/s1600/Screen+Shot+2016-07-20+at+9.43.40+PM.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSs0wa8SotfHPFnTrzn3brI3_MzfdMY_Y8p51gqvVp4F8V3oohwsp7dLlcA864G0uNM31d0Pfjh6hFkDZ4xPh4BnebzVdYB_ixo44hCA0I8A465kaUiQYi5up6u3hsF-wLVXGf7ehpyhk/s320/Screen+Shot+2016-07-20+at+9.43.40+PM.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl6vVvZCAvrkVwsvOV0SbkjWlTZ-HuscFl1khkgTeYvl9ik2lOMLzk_jHyTrG-rJQdY_bUNLDYpcPwaYfE86X2r9-9ZTK79JN8uYZal2JVuxONvBi8ZYVI0KpNQ-tHDvwyc5Y-hX3X8y0/s1600/helloWorld.mp4" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgl6vVvZCAvrkVwsvOV0SbkjWlTZ-HuscFl1khkgTeYvl9ik2lOMLzk_jHyTrG-rJQdY_bUNLDYpcPwaYfE86X2r9-9ZTK79JN8uYZal2JVuxONvBi8ZYVI0KpNQ-tHDvwyc5Y-hX3X8y0/s320/helloWorld.mp4" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Stay tune for my further progress on playing with this new interface. I am having so much fun that I even ordered a Echo Tap. :)</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Happy Coding! </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com1tag:blogger.com,1999:blog-909746912855922547.post-22119970749313647542016-07-26T10:16:00.001-07:002016-07-26T10:16:13.346-07:00Introduction to Conda WorkshopI went thru the Conda Workshop this past Saturday, July 23rd sponsored by <a href="http://www.meetup.com/PSPPython/" target="_blank">Puget Sound Programming Python Group</a> and <a href="https://www.flowroute.com/" target="_blank">FlowRoute</a>. The course was taught by <a href="https://github.com/sandhujasmine" target="_blank">Jasmine Sandhu</a> and <a href="https://www.linkedin.com/in/chris-barker-7b83a318" target="_blank">Chris Barker</a>. Jasmine talked about the basics of the Conda package management system while Chris talked about <a href="https://github.com/ChrisBarker-NOAA/autotools_conda_recipes" target="_blank">Conda Recipes</a>.<br />
<br />
While both topics are very interesting, the introduction to Conda served one step further from my <a href="http://blog.pythonicneteng.com/2015/12/anaconda-environment-and-virtualenv.html" target="_blank">previous understanding</a> of this tool. To be honest, I have been using Virtualenv and Pip most of the time mostly because of familiarities, but this workshop game me some new perspectives about the tool.<br />
<br />
The introductory session notebook link below, it is worth a read if you are interested in what the tool is about: <br />
<a href="https://github.com/sandhujasmine/CondaWorkshop/blob/master/IntroConda.ipynb" target="_blank">https://github.com/sandhujasmine/CondaWorkshop/blob/master/IntroConda.ipynb</a><br />
<br />
Basically, I think there are three reasons to use Conda over virtualenv/pip:<br />
<br />
1. Separation of the binary packages such as NumPy.<br />
2. It is both a package manager (pip) and environment manager (virtualenv). Therefore you can have one file that takes care of environment separation and package installation (think requirements.txt).<br />
3. Channels. It is like rolling a GitHub repo natively into Python, available both in public (free) and private (paid) repo.<br />
<br />
Here are some pictures from the session (I particularly liked the phone booth):<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnc2i5zkYdpbF8YAtJOpEK6ziRpuVSNque35TJdfN2AjLHYYHyAX1GJHDH3HKiL_55UdRdH54OYB0U0mmX0U90qhyj1tHgmI_nk3pJ-ATYdow4PxhglmU0YrSr4viZJjWUgoNoeXH919E/s1600/flowroute_3.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnc2i5zkYdpbF8YAtJOpEK6ziRpuVSNque35TJdfN2AjLHYYHyAX1GJHDH3HKiL_55UdRdH54OYB0U0mmX0U90qhyj1tHgmI_nk3pJ-ATYdow4PxhglmU0YrSr4viZJjWUgoNoeXH919E/s320/flowroute_3.jpg" width="240" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpC7GPx4Csn1m8dWt1qflOKX4nhDN5500SL_Gl4aTHBh3zc_Pgeoh3nMQv0kbmTm8s06t7mSdP13UF-so4dkEDI1As1FDq1r88MFXVVh_yrbTdiBnotb6n606dUbGFXHshBbE7-LJgAJk/s1600/flowroute_2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpC7GPx4Csn1m8dWt1qflOKX4nhDN5500SL_Gl4aTHBh3zc_Pgeoh3nMQv0kbmTm8s06t7mSdP13UF-so4dkEDI1As1FDq1r88MFXVVh_yrbTdiBnotb6n606dUbGFXHshBbE7-LJgAJk/s320/flowroute_2.jpg" width="240" /></a></div>
<br />
I wont repeat anything that is in the IPython notebook, you should check out that link since she is the expert. However, here is a sample workflow that I worked on (flask-ask):<br />
<br />
1. Create Env<br />
<br />
MacBook-Air:Alexa echou$ conda create -n flask-ask-temp1 python=2.7<br />
Fetching package metadata .......<br />
Solving package specifications: ..........<br />
<br />
Package plan for installation in environment /Users/echou/anaconda/envs/flask-ask-temp1:<br />
<br />
The following NEW packages will be INSTALLED:<br />
<br />
openssl: 1.0.2h-1<br />
pip: 8.1.2-py27_0<br />
python: 2.7.12-1<br />
readline: 6.2-2<br />
setuptools: 23.0.0-py27_0<br />
sqlite: 3.13.0-0<br />
tk: 8.5.18-0<br />
wheel: 0.29.0-py27_0<br />
zlib: 1.2.8-3<br />
<br />
Proceed ([y]/n)? y<br />
<br />
Linking packages ...<br />
[ COMPLETE ]|########################################################################| 100%<br />
#<br />
# To activate this environment, use:<br />
# $ source activate flask-ask-temp1<br />
#<br />
# To deactivate this environment, use:<br />
# $ source deactivate<br />
#<br />
MacBook-Air:Alexa echou$<br />
<br />
2. Activate Environment<br />
<br />
MacBook-Air:Alexa echou$ source activate flask-ask-temp1<br />
<br />
3. Install a conda package<br />
<br />
(flask-ask-temp1) MacBook-Air:Alexa echou$ conda install numpy<br />
Fetching package metadata .......<br />
Solving package specifications: ..........<br />
<br />
Package plan for installation in environment /Users/echou/anaconda/envs/flask-ask-temp1:<br />
<br />
The following NEW packages will be INSTALLED:<br />
<br />
mkl: 11.3.3-0<br />
numpy: 1.11.1-py27_0<br />
<br />
Proceed ([y]/n)? y<br />
<br />
Linking packages ...<br />
[ COMPLETE ]|########################################################################| 100%<br />
(flask-ask-temp1) MacBook-Air:Alexa echou$<br />
<br />
4. Install a package that is NOT available thru Conda:<br />
<br />
(flask-ask-temp1) MacBook-Air:Alexa echou$ pip install flask-ask<br />
Collecting flask-ask<br />
Collecting PyYAML (from flask-ask)<br />
Collecting six (from flask-ask)<br />
Using cached six-1.10.0-py2.py3-none-any.whl<br />
<br />
5. Testing<br />
<br />
(flask-ask-temp1) MacBook-Air:Alexa echou$ python<br />
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:43:17)<br />
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin<br />
Type "help", "copyright", "credits" or "license" for more information.<br />
Anaconda is brought to you by Continuum Analytics.<br />
Please check out: http://continuum.io/thanks and https://anaconda.org<br />
>>> from flask_ask import Ask<br />
>>> dir()<br />
['Ask', '__builtins__', '__doc__', '__name__', '__package__']<br />
>>> exit()<br />
(flask-ask-temp1) MacBook-Air:Alexa echou$<br />
<br />
6. Deactivate<br />
<br />
(flask-ask-temp1) MacBook-Air:Alexa echou$ source deactivate<br />
MacBook-Air:Alexa echou$<br />
<br />
7. Delete the Env<br />
<br />
(flask-ask-temp1) MacBook-Air:Alexa echou$ source deactivate<br />
MacBook-Air:Alexa echou$ conda remove -n flask-ask-temp1 --all<br />
<br />
Package plan for package removal in environment /Users/echou/anaconda/envs/flask-ask-temp1:<br />
<br />
The following packages will be REMOVED:<br />
<br />
mkl: 11.3.3-0<br />
numpy: 1.11.1-py27_0<br />
openssl: 1.0.2h-1<br />
pip: 8.1.2-py27_0<br />
python: 2.7.12-1<br />
readline: 6.2-2<br />
setuptools: 23.0.0-py27_0<br />
sqlite: 3.13.0-0<br />
tk: 8.5.18-0<br />
wheel: 0.29.0-py27_0<br />
zlib: 1.2.8-3<br />
<br />
Proceed ([y]/n)? Y<br />
<br />
Unlinking packages ...<br />
[ COMPLETE ]|########################################################################| 100%<br />
MacBook-Air:Alexa echou$<br />
<br />
There you have it, one step further to manage your Python work environment.<br />
<br />
Leave me a comment for your thoughts! Happy Coding!<br />
<br />
<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com0tag:blogger.com,1999:blog-909746912855922547.post-63113744479200631732016-07-18T20:19:00.003-07:002016-07-18T20:19:28.637-07:00The Making of Network Automation Nerds Pre-Flight PodcastWhen I was at PyCon 2016, I had the chance to talk to Michael Kennedy from <a href="https://talkpython.fm/" target="_blank">Talk Python To Me</a> a few times. I have been enjoying his podcast for a while now, even was part of the panel on people who recently gotten a job as Python developers.<br />
<br />
I tried to pick his brain about his journey and experience. The conversations were really enjoyable, we shared a common interest in Python and building life-style business (think Tim Ferriss of 4-Hour Work Week). Of course, he is waaaay ahead of me as far as progress. :)<br />
<br />
One of the things he mentioend was how Podcasting had helped him in building up his audience and that I might give it a shot. After giving it some thoughts, I thought, 'Why not?' It wouldn't hurt to at least learn about the workflow as long as the upfront investment is not that much. Sure enough, after a day or two of planning, I was able to submit and received the approval for my Podcast from iTunes (because who else is out there, really?):<br />
<br />
<a href="https://itunes.apple.com/us/podcast/network-automation-nerds-podcast/id1128239093" target="_blank">Network Automation Nerds Podcast</a><br />
<br />
"THE" most useful resource that I found, was this tutorial from <a href="http://podcastanswerman.com/learn-how-to-podcast/" target="_blank">PodcastAnswerMan</a> as well as this <a href="http://www.smartpassiveincome.com/how-to-start-a-podcast-podcasting-tutorial/" target="_blank">step-by-step-guide from SmartPassiveIncome</a>. I wont repeat his instructions because he does a much better job at his methods. The videos are short and enjoyable so highly recommended that, if interested, go thru them in one setting and drill down on the parts you might need more help on.<br />
<br />
Personally, I chose to picked the cheapest way forward:<br />
<br />
1. The $2.99 iPhone app for recording audio file.<br />
2. This <a href="https://www.amazon.com/gp/product/B00EO4A7L0/ref=oh_aui_detailpage_o05_s00?ie=UTF8&psc=1" target="_blank">microphone</a> that was recommended by SmartPassiveIncome on the link above. It is a bit pricey at $79 but I figure I will be able to reuse them for other projects as well.<br />
3. My audio file was put on my a web server that I already have.<br />
4. The initial RSS feed was done via Blogger, which was free. As recommended by PodCastAnswerMan, this can be changed if you have a bigger audience later on.<br />
5. The middle feed was done on Feedburner, combine with step #4, this provides the most flexibility to bootstrap the podcast quickly as well as expansion opportunity if your audience grow later on.<br />
<br />
Overall, I was surprised at how easy the whole process was. All for less than $100. Even with the equipment I bought they can be reused later on. I love the fact that we are now all self-branded and we can deliver our message to the biggest audience possible as long as they offer value to others.<br />
<br />
Now comes the hard part, offer value to people who give the Podcast a shot and offer them incredible amount of value!<br />
<br />
Leave me a comment if you have any questions about the process of making this go live. :)<br />
<br />Eric Chou http://www.blogger.com/profile/11336226720003537549noreply@blogger.com1