Python for Unix and Linux System Administration

Python for Unix and Linux System Administration
Authors
Noah Gift, Jeremy Jones
ISBN
0596515820
Published
02 Sep 2008
Purchase online
amazon.com

Python is an ideal language for solving problems, especially in Linux and Unix networks. With this pragmatic book, administrators can review various tasks that often occur in the management of these systems, and learn how Python can provide a more efficient and less painful way to handle them. Each chapter in Python for Unix and Linux System Administration presents a particular administrative issue, such as concurrency or data backup, and presents Python solutions through hands-on examples.

Page 2 of 2
  1. Editorial Reviews
  2. Customer Reviews

Customer Reviews

skippylou said
I felt this was a much better book for me than two other Oreilly titles for picking up Python. That being said, I do believe having a background in another language (Perl/Bash/etc.) and being a Linux/*nix admin is required to get the most from it.

It gave great examples that made practical sense and covered a ton of topics.

My only knocks would be I wish the iPython chapter was not included and the final chapter "Pragmatic Examples" was extended.

If you have never used Perl, or another language, the intro section may not be enough to get you to follow along - that being said, most admins I'm sure have already been exposed to a language of some sort.

M. Helmke said
I have four Python books on my shelf. I like the language, at least in theory. It is easy to read, clear, and powerful. In practice, I really don't program much. I was hoping that this book might push me over the edge from writing shell and PHP scripts for my simple needs into Python land. So many of my friends love the language.

I read the book this week. There are a lot of great ideas in there that would be useful for a sysadmin. The examples chosen are generally practical and useful. I was a bit disappointed by the occasional typographical or capitalization error, especially in code examples and discussion, which are not uncommon in first edition books, but are generally uncommon from O'Reilly books. I also found the early emphasis on iPython to be a bit excessive.

This is a little shorter than my usual review, mainly because I can't think of much else to say about the text. It isn't bad, but it isn't great. A sysadmin who is motivated to use Python will find it useful as a foundation. A veteran Python programmer who wants to use the language for systems administration will probably find the book filled with stuff they could have figured out anyway. I wanted to love the book, but I didn't. I didn't hate the book, either. I just feel a bit "meh" about it.

Eric Lake said
I recently got my hands on a copy of "Python for Unix and Linux System Administration". After reading it, I felt the time I've invested in reading it was well spent. The author introduced the reader to many different situations where python would help make their lives as system administrators easier, without confusing the reader with some complex forms or statements. My feeling is that this book is aimed at people who want to use Python to solve their problems quickly and efficiently, but only have a limited experience with the language - and the books fits that purpose well with its rather superficial approach that the reader can later extend later on with various available resources. It would only be fair that I too mention some of the shortcomings that I noticed while reading this book.

Pros:
1) The author introduces the reader to ways that Python can be used.
2) Most of the time there will be more than one way to accomplish a task. The author at times presents a scenario and showed the reader how to do the same task with different modules. This places the choice of which to use back where it belongs, with the reader.
3) The book has a website (most do these days) where the code examples can be downloaded. http://py4sa.appspot.com/

Cons:
1) More time was spent on iPython than was really needed.
2) The case of a word is important in Python. For instance "import Sys" and "import sys" are two completely different things. There were quite a few occasions where a module name was used as the first word in the sentence and because of that it was capitalized.
3) There was once instance that I saw where a script example had no indentation at all. Trying to run it would have resulted in complete failure.
4) It would have been nice if the script examples were named instead of leaving it to the reader to figure it out based on the imports used in another example.

When all is said and done I think I would recommend the book to others if I knew that they had at least some background with Python. And I would highly recommend that they check the addendum and errata pages.

John McAdams said
The example scripts in the PDF don't always work and have errors. Check out this snippet from page 210 of the PDF:

def create_checksum(path):
"""
Reads in file. Creates checksum of file line by line.
Returns complete checksum total for file.
"""
fp = open(path)
checksum = hashlib.md5()
while True:
buffer = fp.read(8192)
if not buffer:break
checksum.update(buffer)
fp.close()
checksum = checksum.digest()
return checksum
Here is an iterative example that uses this function with IPython to compare two files:
In [2]: from checksum import createChecksum

In [3]: if createChecksum("image1") == createChecksum("image2"):
...: print "True"
...:
...:
True
In [5]: if createChecksum("image1") == createChecksum("image_unique"):
print "True"
...:
...:

The first example defines create_checksum and the second calls createChecksum. But that's not all, the indentation is off and there is no main method in the first example. I'm spending more time figuring out why the examples don't work than learning Python. If you like proof reading and troubleshooting syntax, this is the book for you.

The book is supposed to have an image of all the scripts somewhere but there is not link in the PDF. At least not in the first 200 pages.

D. Stanley said
I highly recommend this book for anyone in the systems admin field, or for anyone who does python development on unix platforms. It has a wealth of knowledge and tips that will give you the tools to be a more productive sysadmin.

This book will be required reading for my next systems administration class!

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Computer Science is no more about computers than astronomy is about telescopes.” - E. W. Dijkstra