Home > Python > stepup2: Python

stepup2: Python


posting after a long time, its been over 2 months since the last post. can’t help it, that’s the life of a sysadmin. ok, moving on to this post, as i have decided that i would be writing on mostly python, as that has become my favourite programming language. now after a long break, continuing back on my learning python journey, I have picked up this Book: Python for Unix and Linux system administration By Noah Gift and Jeremy Jones. I have still not completed the book, just reached the 4th chapter, but I am seriously liking it, After recommending Magnus Lie Hetland’s “Beginning python from novice to professional”, this is one another book that i would recommend for beginners as well as for any person wanting to learn python, its very well and clearly explained, and the one good thing, i liked is, lot of practical examples.


Please don’t be bored, To start with, Authors Acknowledgement, Yes!, I am mentioning this part, it might sound boring, why need to start with Acknowlegdement, If you look at Noah’s acknowledgement, its a very very long Thank’s giving list, But!, I liked it, that was something really humble, he has thanked each and every freind and mentor he has met, even his teachers at school, its really quite interesting.


Moving onto the next best part Chapter 1, “Introduction”, the question, Why Python?, I clearly agree to what the Author’s have explained about why to use python. Some reasons from the book that i would mention, Yes, Python is easy to learn. If a language can’t help you become productive pretty quickly, the lure of that language is severely diminished. Why would you want to spend weeks or months studying a language before you are able to write a program that does something useful? This is especially the case for sysadmins. If you can’t learn a language quickly enough to start writing scripts with it almost immediately, you should strongly question whether you should be learning it. However, a language that is easy to learn but doesn’t allow you to do fairly complex tasks isn’t worth much either. So the second reason to consider Python to be an
excellent programming language is that, while it lets you start simply, it also allows you to perform tasks that are as complex as you can imagine.


In this introduction part they have also taken some little examples and compared doing the same task in python and then doing the same thing in Perl and Bash and the difference between them. And there’s this little article called “Motivation”, this is a really good little article for people who are new to programming and are learning programming for the first time.


Then they move on to “The Basics”, here you will get to know about ipython, its features, benefits and how to use it, even i never knew there was something like ipython and really useful. along with ipython the chapter takes you further on functions in python and import statements in python and other basics.



Moving on to Chapter 2, It is all about Ipython, ipython is a python shell, and it has lot more features than the standard python shell, In this chapter, you will get to know, its features, how to install it, how to use it, how to use the import functions, configuring it, using the Magic functions of ipython.


Chapter 3, “Text”, yes, this chapter is about string and text processing, Python’s Built-ins and modules, Unicode srings, regular expressions, working with files, ElementTree.


Chapter 4, “Documentation and Reporting”, this chapter is about gathering, formatting and prcessing data. you’ll learn about Automated Information Gathering, sending and receiving emails, Information Formatting, generating graphs, PDFs and csv excel files.


Chapter 5, “Networking”, this chapter is about creating sockets, testing the connections, protocols: http, ftp, RPC, ssh, Pyro framework, Twisted the network framework, Scapy.


Chapter 6, “Data”, This chapter is about moving of data from one location to another, sysadmins do these sruff using tools like scp, cp, mv or rsync, in this chapter you will learn about doing these tasks by scripting in python and also doing some more useful stuff. working with paths, directories, files, comparing the data, archiving, compressing and restoring the data.


Chapter 7, “SNMP”, this chapter covers the aspects of SNMP: autodiscovery, polling/monitoring, writing agents, device control, and finally enterprise SNMP integration. all of these things are going to be done with Python.
SNMP installation and configuration, IPython and Net-SNMP, Discovering a Data Center, Creating Hybrid SNMP Tools.


Chapter 8, “OS Soup”, this chpater is about using python across different OS distributions, From Linux, to Solaris, to OS X, to FreeBSD, it needs to be in your toolbelt. here you’ll learn Cross-Platform Unix Programming in Python, Creating a Cross-Platform, Systems Management Tool, Creating a Cross-Platform Build Network, Amazon Web Services with Boto, Google App Engine.


Chapter 9, “Package Management”, this chapter is about packaging and managing Python code and your Python environment. Setuptools and Python Eggs, easy_install, Authenticating to a Password Protected Site, Using Configuration Files, Creating Eggs and lots more.


Chapter 10, “Processes and Concurrency”, this chapter is about processes, using the subprocess module, its features, threads, creating and managing threads, scheduling the process.


Chapter 11, “Building GUIs”, this chapter is about PyGTK, curses, and the Django web framework. Building a Simple PyGTK App, Building an Apache Log Viewer Using PyGTK, Building an Apache Log Viewer Using Curses. After the GUI part come the Web applications part, its taking your python applications to web, for me this was the part i needed, because as a sysadmin i nevert make or was never required to make GUI tools. using the Django framework.


Chapter 12, “Data Persistence”, this chapter is about storing the data for its later use, Simple Serialization, Pickle, Cpickle, shelve, YAML, ZODB, Relational Serialization, SQLAlchemy ORM.




Chapter 13, “Command Line”, this chapter is on creating command line tools, Integrating Shell Commands into Python
Command-Line Tools, Integrating Configuration Files.


Chapter 14, “Pragmatic Examples”, In this final chapter you’ll learn, Managing DNS with Python, Using LDAP with OpenLDAP, Active Directory, and More with Python.


This was just a little overview and my personal review about the book, as i liked it, and personally i would recommend this book to any guy wanting to learn programming, especially as the name of the book specifies its book for the sysadmins, yes, its one great book for the sysadmins. the explanations have been made very clear. If there are any corrections or suggestions or feedback, Please feel free to comment, Also if there are any books related to python, that you may have read, i would be happy if you could share your views with us. you can also mailme at: activespark.info{AT}gmail{DOT}com.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.