Showing posts with label Book Review. Show all posts
Showing posts with label Book Review. Show all posts

Saturday, August 24, 2013

[book review] Raspberry Pi Cookbook (early release)

This is a book review for Raspberry Pi Cookbook in the early release as of Aug, 2013.

At the time of this review, the book is roughly 160 pages with 6.11 recipe as the last. Compare to the estimated 500 pages of the print edition and estimated December 2013 publishing date, there should be a ton more to come. 

This is the same author as many of the Arduino books, so I was looking forward to some of the arduin-Pi integration recipes. They were not found in the early release, but presumably will be available in the later date as the book gets completed. The early chapters cover the basics, setup, cabling, networking, getting around the Linux interface, basic Python, etc. Personally I am a bit beyond the basics, but always good to have a one-stop book for these things other than having them all over the bookmarks. 

As with book of this nature, they introduce the basics to get an aspect of Raspberry Pi up and running, but mileage may vary depending on how far you want to take them. I did learn a new thing or two on file and screen sharing natively on Mac (instead of VNC), and packages that allow easy camera capture server of a Pi. 

Overall, I enjoyed this book and can't wait for the rest of the recipes to come out.  



Sunday, August 4, 2013

[book review] Practical Lock Picking, 2nd Edition

This is a book review for Practical Lock Picking, 2nd Edition.

This post has nothing to do with Python or Network Engineering, please skip this blog post if that is what you are looking for. 

For those of us in computers, sometimes it is fun to step outside of our high tech bubble and look at some physical interaction of devices; in this case, physical penetration of the locks. When I was little and growing up in another country, MacGyver was a mega hit series. He has always been able to save the world with a piece of gum and swiss army knife, and of course, pick every single lock with ease in under 5 seconds. When I was reading this book, it kind of reminded me of how disconnect TV fiction was with reality. It is possible, but I doubt it can be done in a few seconds. 

This book is a fun book to read. It begins with the concepts behind the two most common lock types found in N. America and around the world, the Pin lock and the wafer lock: 

There are lots of illustration and pictures that helps you understand the concept. To me, the concept is actually surprisingly straight forward, the strength is all in the mechanics of manufacture in making the lock. As the author explained, mechanical weakness leads to security weakness. I don't know about you, but some of the older colo facilities and peering exchanges the racks were protected by simple locks, so in theory once can pick this locks and power down the devices inside. Physical protection sometimes is overlooked. 

After the first two chapters, the next four were all about the right approach, training, tools, and techniques. If you really want to be a lock smith, I'd imagine the right training approach and tips can save you a ton of time. For me, I am reading the book mainly to understand the concepts, so I was not too engaged, but none the less good to know. 


Because I did not try out the techniques and the exercises mentioned in the book, I am going to give it a four star. But I got what I received what I wanted out of the book and it was an enjoyable read. 


Friday, July 5, 2013

[book review] Learning Python 5th Edition

This is a book review for Learning Python 5th Edition.

"Learning Python" was one of the books that helped me get started in Python and it continues the superb quality of books that OReilly 'Learning' series produces. It gives detail and clear explanation of different aspects of the language plus many bite size examples, with interactive prompt whenever possible. A notable difference from previous edition is that it spends considerable amount of pages comparing 2.x and 3.x, which is necessary for moving people into the Python 3.x space for sure. 

As someone who doesn't code for food and just using the language as an enabler, I frequently encounter colleagues and peers who wants recommendation as the first book for getting into the language. As a personal preference, this is 'not' the book I would recommend, perhaps the second or third book. Dont get me wrong, it is a good investment of your time, but if you are brand new to the language, you cant just read the first few chapters and start using the language. At 1600 pages, it doesn't get into Python statements (if/else, while) until almost 400 pages into the book. By comparison, the third edition was 752 pages and the latest edition of 'Learning Perl' was 390 pages. I appreciate nesting, duck typing, and Polymorphism as much as the next guy, but perhaps a bit top heavy for people similar to my background to begin with. 

Other than my small complain, this is a good overall value for your time and money. Cheers. 


Tuesday, June 25, 2013

[book review] Python Cookbook 3rd Edition

This is a book review for Python Cookbook, 3rd Edition.

I have not met an O'Reilly cookbook that I don't like, this is no exception. Mr. Beazley's "Python Essential Reference" is one of the desktop reference book that I keep close, so I was looking forward to reading this book. One aspect that is unique to this edition is that it is meant to be work in Python 3, most recipes were created or re-written with Python 3 in mind. 

As with typical cookbooks, the book examples are probably not going to be the full solution to your problem, but solving a piece of the puzzle for you. At 700+ pages, the book is full of tips and best practices to allow one to work in the right direction in search of solutions. The reader can look at the appropriate modules deeper if needed be. Python has a large number of libraries, which is its blessing but finding the right library is sometimes half the battle. In this regard, narrowing down the libraries, say PySerial, for connecting thru serial interface can save you hours. 

I work with File I/O and Text a lot, so I especially enjoyed the two chapters on these topics. 5 stars for the book. 





Wednesday, June 12, 2013

[Book Review] Violent Python

This is a book review for Violent Python: A Cookbook for Hackers, Forensic Analysts, Penetration Testers, and Security Engineers.

I had a lot of fun reading the book, this book is full of ideas that you can expand on. Midway thru the book, I used an example in the book to solve a problem that I was facing at work. It illustrated the power of Python, the precise readability coupled with LOTS of third-party libraries makes Python the language of choice for the author and may others for doing the type of security work that they do.

It is a nice collection of existing tools (os, sys, re), along with some popular libraries (pexpect, beautiful soup, scapy, dpkt), as well as some specific purpose built libraries (PyBluez). Finding the right libraries can really be the difference of weeks vs. days of development cycle. Using them in the right combination too.

The book, of course, can be used for both good and evil. This is in part why unlike some of the other book reviews, I am not posting some of the example code I have written. It just feels kind of personal, but to be sure the examples work, some needs minor tweaking to fit your needs. It is also nice that the book provides a VM that came pre-packaged with a lot of the tools pre-installed. In short, "Solving complex problem with minimal code", as the author stated. I would highly recommend this book.

Thursday, May 16, 2013

[book review] Juniper Networks Warriors

Taking a break from all the SDN/POX/OpenFlow from the last few weeks, I have the pleasure of reviewing Juniper Networks Warriors today.

Title: Juniper Networks Warror
Publisher: O'Reilly Media
Product Details:
http://shop.oreilly.com/product/0636920022978.do

I really like this book. I have held a number of different posts in networking, and can related to the analogy of a 'Network Warrior'. Heck, the title even rhymes with my blog title, right? This is a no-none-sense, practical-approach, real-world-example kind of a book. This book assumes you are familiar with the technologies discussed, or at least have some passing knowledge, and dive directly into the design, trade-offs, and implementation details. I personally enjoyed this approach. The configuration syntax is not nearly as important as the design implications and result. This book also touches on Layer 8 and Layer 9 (money and politics) when facing networking projects, that is a reality of any network engineers.

The bottom line is that if you are deploying a project similar to any of the examples, especially using Juniper gears, this book is probably worth its weight in gold for you. It will probably save you time and effort right away. But even if you are not using Juniper gears described in the book, it is still worth your while to see the design process, be familiar with the product offerings from Juniper, and be prepared to have this tool in the bag if needed.

I would highly recommend this book to any inspired 'network warriors'.



Sunday, December 9, 2012

[book review] Arista Warriors



I recently reviewed the book, Arista Warriors. Obviously the Python chapter interested me the most, here is the result of the output as I tried the example in the book to modify the 'show version' output with a few lines of Python. 

***** Experiment on Arista CliPlugin *****


[user@switch CliPlugin]$ pwd
/usr/lib/python2.7/site-packages/CliPlugin
[user@switch CliPlugin]$ sudo vi VersionCli.py

def showVersion( mode, detail=None ):
   <skip>

   # Print commands (delete after)
   print "*" * 10
   print "I dont really like Pie"
   print "*" * 10

[user@switch ~]$ Cli -c "show version"
**********
I dont really like Pie
**********
Arista DCS-7504
Hardware version:    02.00
<skip>
Software image version: 4.10.3
Architecture:           i386
Internal build version: 4.10.3-937242.EOS4103
Internal build ID:      a229c9db-af32-4e62-a4f7-5711e977d968

Uptime:                 6 weeks, 1 day, 22 hours and 51 minutes
Total memory:           4100488 kB
Free memory:            1758148 kB

[user@switch ~]$

That is pretty cool. But how do I write more native looking commands? Or how do I write an agent that can mount to SysDB directly? I dont know, but here are the modules that I plan to look more into for the command part, stay tuned: 

import Tac, CliParser, BasicCli, os, Tracing, EosVersion, Ethernet


***** Review *****



Here is the Review as appeared on Amazon: 

I have been working with Arista switches for a while now, this is the manual that probably should have came with the Arista switches. As the author mentioned, the command syntax the EOS format is very similar to Cisco IOS. In fact, I have heard of stores where engineers simply copy and paste IOS configurations into EOS during migration and worked just fine. However, to tap into the capabilities that makes Arista a game-changer one has to get into the realms of SystemDB, Python, Linux user space, etc. Anybody can type into commands, but the real challenge lies within the impact and scope of what you are trying to do. This book does a good job of doing the practical stuff that you can use in your day-to-day, as well as the concepts behind them.

Overall, I would recommend this as a solid investment of money and time for anybody looking into Arista switches. 

Pro: 

- Real world examples. 
- Solid explanation of concepts. 
- Sense of humor for an otherwise dry subjects. 

Notes, suggestions, erratas: 

1. Maybe more coverage into the current fat tree design with spine/leaf/core, etc. This is one area that Arista differs from competitor for the number of ECMP next-hop, tcam division of host routes, etc. 
2. Power draw is critically important in large scale data centers, Arista has some good innovation in this area with PHY-less design. 

*** Virtual Machines on Arista ***

1. If you don't have an Arista switch handy to practice, or just want a safe environment to practice with, you can run vEOS off a VM: vEOS, https://eos.aristanetworks.com/2011/11/running-eos-in-a-vm/ by Andre Pech. 
2. When you are in a pinch, you can also run another VM direction in EOS: Running Virtual Machines in EOS, https://eos.aristanetworks.com/2011/09/virtual-machines-in-eos/ by Mark Berly. 

*** sFlow ***

The whole chapter on sFlow probably warrants more coverage. This is one important telemetry tool that offers lots of information and the right direction going forward, IMO. It offers the ability to do push telemetry vs. pull such as SNMP that offers more scalability. 

It is also important in the sense of data center billing for the counter. If you are, say, Yahoo and have one of the biggest Hadoop cluster. You would want to know who is your top talker so you can bill them the network overhead accordingly. This is typically done with NetFlow that exports to collector (more on it in a bit), but if you have a network of Arista switches that does not cross the core, sFlow counter is your current best bet. 

Because aggregation is done in the onboard flow cache 'before' it sends to collector, NetFlow often falls down in even moderate amount of traffic in data centers. You are forced to scale down on the flow sampling rate that increases the error delta. sFlow on the other hand, just samples and push all the intelligence into the collector. 

The author hints at this, but here is an early peak on troubleshooting data plan traffic with sflowtools: 

1. Running the open source sflowtools directly on Arista switches for troubleshooting data plan traffic that does not cross CPU. https://eos.aristanetworks.com/wiki/index.php/EOSTroubleshooting:Local_sFlow_Collection_and_Analysis
arista#bash sudo /mnt/flash/sflowtool -t | tcpdump -r - -vv

*** Python ***

Python should have more coverage in the book as that is what Arista CLI is built on. Just some pointers toward motivated Network Engineers which modules to look more into and the location of the files would be helpful. 

1. I have asked when Python 3 will be included in Arista, best guess is when Fedora updates their OS to make 3 default. 

*** Random Notes about the book ***

1. I think 'sh run all interface' was in 4.7.x, then for some reason went away in 4.8.x, then came back after 4.9.x.  
2. I wish the book covers more on the SysDB mount points that Mark Barley points out on EOS Central. 
3. IPv6 chapter in the works with 4.10.x code? 
4. Nice tip about generating traffic at 'ping -s 15000 -c 10000 10.10.10.15 > /dev/null &' I have done that before but couldn't see the traffic right away and killed it. 
5. Why woundn't cron work on Arista (chapter 23)? 
6. Nice tips: didn't know that tcpdump can be executed directly from EOS, files other than selected few locations do not survive reloads, emails, etc. 
7. ZTP chapter: chapter typo, should be EOS 4.7 and after, not 3.7. 
8. ZTP chapter: instead of identifying by mac address, should identify via relay agent or the place of kingdom (show lldl) via script instead of by mac address. The mac address change due to RMA, typo. Also manually mocking DHCP config file does not scale. 
9. Event-Handler chapter: More event-handler trigger is indeed needed in Arista in order for the feature to be more useful.
10. Event-Handler chapter: tJust like regular bash script, you can 'demonize' and chain the commands with ';'.
22. Event-handler chapter: There is at least one bug in event-handler in 4.8.3 that configuring 'on boot-up' triggers the event-handler right away. Be careful if the startup script include anything that is production impacting. 
23. I like the 'advance usage of sqlite' a lot, gives me some ideas for using sqlite for other features as well. Maybe show the Python integration with sqlite for script purposes?
27. I like what the author pointed out the different between the default flash: location vs. having to specify full Unix path via file: command. I wish I had known this, would've saved me a some time copying stuff from /var/log -> /mnt/flash -> transfer. 
28. CloudVision: I wouldn't recommend the use of XMPP in production either. Use the upcoming JSon API instead. 
29. Page 360, pretty sure that 'spline' is a typo for 'spine'. 
30. Here is a talk by Andy Bechtolsheim in NANOG 55, helps to understand Arista's vision: http://www.nanog.org/meetings/nanog55/abstracts.php?pt=MTk0MSZuYW5vZzU1&nm=nanog55

*** Commands that I wish the book included ***

1. favorite command: 'show interface counters rates | nz'
2. switch(s1)#sh logging last ?
  <1-9999>  Number of time units (sec|min|hr|day)



Sunday, November 25, 2012

[book review] Python for Kids



I came across a postcard bearing this book's title in OSCON 2012 at the No Starch booth. I remember thinking to myself at the time, "I wonder if this is the book I will use to teach my kids how to program in Python". I also wonder how this book is different from other similar titles, say, "Invent Your Own Computer Games with Python". Both books intend to teach young kids how to program, and both are heavily involved with GUI in order to engage interest. Besides open source vs. costing money, this book has longer chapters that takes longer to read and practice. Important factor to consider if you are teaching a kid to program. 

The biggest difference, however, is that this book teaches 'all' the fundamentals such as functions, class, objects, and some standard libraries, and it is less game-ish (no PyGame). Considering the scope of the topics it tries to teach, I came away very impressed. I thought the author did a great job explaining complex concepts with everyday words. 

In this book, as you would expect from a intro to programming book for kids:  
- list one way to do things without going into details of alternative ways. 
- Lots of analogies for concepts, i.e. "variables are like labels", "think of a string as a collection of letters", "A function is a chunk of code that tells Python to do something", etc. 

I also wonder what is the right age for a kid to start. Since the book starts by doing simple calculation starting in Chapter 2, I'd say the starting age for the book is whenever the kid is comfortable with simple math, mileage may vary. Since the author stated that he has started to program since the age of eight, maybe that is what he had in mind? 

A few notes I took while reading: 

- MacOS X install instruction is a nice touch on using Automator to open up Python IDLE. 
- I would recommend reading this book in a format with color to take advantage of the illustration. 
- Author did away from all of dictionary reference to the concept of map. In my opinion, this might create more problem down the line or when reading documentations. 
- A pretty steep jump from Chapter 3 of built-in variables to Tkinker Turtle GUI program in chapter 4.  
- Suggestion for Chapter 4: remind the young readers to place the IDLE window and Canvas window right next to each other in order to see the turtle move interactively. 
-  Suggestion for Chapter 7: a more detail step process when first introducing the nested loop in a function since that is the first time the loop and function concepts came together. 
- Chapter 1 to 8 covered all the programming concepts, starting chapter 9-12 introduces some of the standard libraries, file I/O, etc. Then move on to GUI with Tkinter.
- Chapter 12 should be executed under Python 3. In Python 2, the 'T' is capitalized where Python 3 the 'T' is lower case (as illustrated in the book). There are other differences that differs between the two versions, I think. 
- Starting from Chapter 13 there are examples of game projects, create from start to finish. 

I would recommend this book for anybody wanting to learn Python programming. 


Saturday, November 24, 2012

[video review] Building Open Source Programming Skills at OSCON 2012


O'Reilly Product Page

The two talks I find the most valuable for me are the API talk and the code review talk.  Out of which I think the API talk would serve as a nice base when discussing API to network vendors. 

Review: 

The value of the talks vary wildly for me. Some are interesting and some I can't help but to tune out. I think for a large part it is because I am not a developer, i.e. I don't code for food. I spend about at the most 10 hours a week to write scripts and consume other people's code. But I would classify myself as the curious type, and I have watched various online tutorials and books so that most terms in the talks were not foreign to me. However I still find a few of the talks difficult to consume unless you are really interested in the topic. My language of choice is Python, so naturally the topics that were based on Python I can get more out of. General topics such as code review, API certainly offered values as well. Maybe I am not the target audience so please take my feedback with my background in mind. 

Below are my one/two-liner for each of the talks. 

- 1. Learning Online: A bit scattered presentation, some interesting stats on how programmers learn. But there is not really a ah-ha moment for me where a lot of insights were shared. 
- 2. Light Table: "ability to traverse abstraction" by 'poking at different stuff'. 
- 3. C++11: Some new look into C++11, in depth and focused on the topic. 
- 4. Dart: Dart to JavaScript introduction, a combination of history and scanning the language. When C and JS have a baby. 
- 5. Hypermedia API: wish there were more examples in the demonstration. 
- 6. Code Review: I don't think anybody disagree with the need for code review, but always nice to have it in a structured presentation. 
- 7. Erlang: A bit hard to understand. The speaker's passion and method of exploring Erlang is actually more interesting than the language itself. 
- 8. Generic Programming: A bit too high level for me. Programming language starting with algorithm instead of objects and types. 
- 9. Functional Programming: Makes me realize how hard it is to go back to functional language after OOB/Interpretive. 
- 10. Anit-Patterns: Entertaining talk that provokes some thoughts about software development best practices in a funny way. The bad anti-pattern with the voice of reason. Most of the time we know the best practice, but reality gets in the way of following.
- 11 Mocking and Testing: This is a very enjoyable talk about testing change in Google hosting engine. I like the compare and contrast between the old and new and some insights into the philosophy. 
- 12. Go: Gofix is an impressive concept and tool. Quickly try out changes without breaking existing base, rollback if does not work out. 
- 13. API: "Valuable services hides API sins" is a great quote. Valuable, Planned, Flexible, Managed, and Supported. 





Sunday, October 7, 2012

[Book Review] Version Control with Git

Book Review for Version Control with Git: Powerful tools and techniques for collaborative software development
This is the first time I look at Git as a basic tool to help me keep my scripts in order. I don't code for living, all the places I have been to already has a set of version control system in place for developers. The quickest way to get going was to leverage the existing tools. It is not until now that I write enough scripts that keeping them in order is starting to become an issue. I am a big believer in 'learn once, use many times', so even though Git sounds like an overkill for my purpose, I have decided to explore the possibility of using Git for my projects. 

Half way thru the book, I have already decided that this is probably going to be the only book I will ever need for Git. Combing with the build-in manual and online documentation for the latest features, there is no need for a second book on Git for my purposes. The book starts with quick history and introduction, then goes into more depth on each of the aspects of Git, starting from the most used to advance. 

For regular users, reading up to Chapter 4 will likely be a good starting point start using Git and reference back here and there. Chapter 3 gave a good tour of the most used commands and Chapter 4 introduces the basic concepts of Git. Since the main purpose of Git is for collaboration of coding, it is likely that once you understand the concepts, you will need to talk to your fellow coders to come up with a agreeable setup. 

Personally, I think it is ok to start reading a little faster from there on, keep an eye out and slow down when you see an applicable concept, but knowing where to look back later when you need the information is the way I approached it. 

Chapter 20 is a good chapter to read in depth if you are using SVC but trying to convert to Git, Chapter 21 is a good chapter on GitHub. 

Overall, I feel it was a wise investment of my time in reading this book. 

I will follow up with another post on getting started with Git. 




Sunday, September 16, 2012

[Book Review] Mac OS X Lion: The Missing Manual

Book Review for Mac OS X Lion: The Missing Manual , by David Pogue, ISBM 1449397492

This post will not touch much on Python, I was hoping to pick up enough AppleScript chops to use Python as an automation glue for Mac OS X by reading this book. But it turns out that would not be the case. So please skip this if you feel like this is a distraction from the topic.


I bought the first Mac OS X Missing Manual back in 2002 with my first iBook. Over the years I bought the Leopard and Snow Leopard versions of the missing manuals, so this is my fourth Mac OS X Missing Manual book. Pogue's book is really what I ever needed if I wanted to learn something about the Mac OS X besides a quick search online. It is an excellent source of information, sometimes I feel it is more than what I needed to know but having more information is better than the other way around, I think. One thing I did learn is that I prefer digital copy of technical books to be able to work on the topic covered, this book in particular was most useful when I can try out the examples as I read them. 

The overall theme really is the iPod-ification and social integration of the Mac OS as many article have pointed out, and Pogue's book points them out whenever possible. 

After more than 10 years of using Mac and working with *Nix system on a daily basis, there are still new items that I picked up from this book, I am sure some of them have been there and i just never knew about them. Here are some examples:

- New share menu: part of the iPad-ification of the new Mac OS. 
- Spotlight tips (quick calculator and dictionary). 
- Use keywords to search with limit (email, folder, app),
- Organize LaunchPad with folders and tricks.  
- Things I don't use enough to go deep into: iCloud, Time Machine, Dashboard, 
- Instant Accented Characters (i.e. holding down e will give you options for accented e in other languages).  
- Dictation: The new speak to type feature (somebody say iPad?) :)
- Chinese appeal: New font, new dictionary, Safari Baidu search, write Chinese via trackpad. 
- Share Bottom, wow, they are everywhere. 

Bottom line, if you are new to the OS or new to Mac, I would definitely recommend this book.