Posts Tagged ‘python’

31st March
2010
written by Nick Anderson

I recently had a need to push out a few settings to a group of iLOMs on new Sun servers. I really despise using a web interface for everything so I took the ssh route. The first thing I tried to do after determining the commands I needed was to shove the commands in with ssh directly.  I quickly became apparent that route just wasn’t going to work.

When you log into the iLOM “daemons” need to initialize. Based on the errors that I got while trying to shove the commands in with ssh I assume these “daemons” have something to do with access controls. It became apparent that I needed to use expect if I wanted to automate over the ssh connection. I used the pexpect module in python and wrote a simple script to push a batch of commands to a list of hosts.

It was written from the point of view that most of these settings need to happen when you receive a new box so it defaults to the iLOM default username and password (root/changeme). I’m not sure how often I will use this tool but I will be sure to keep my command snippets in version control as its highly likely I will be using the same settings over and over again or with slight permutations.

iLOM-commander can be found in my github (patches accepted)

Tags: , ,
4th March
2010
written by Nick Anderson

Python has become my language of choice for automation and general scripting. Its nice to have an editor that makes things easier when your doing things. Its also nice to use an editor that you can find just about anywhere. I have customized my vim to make doing things in python much quicker and this is an old post where I talk about some of the modifications.

Vim customization for python

Tags: , ,
18th December
2008
written by Nick Anderson

Im sure everyone is familiar with smb messages especially as everyone was assulted with them about 10 years ago (stupid soho routers and spammers unite!). Anyway, there are clients for linux like Linpopup. Well recently I didn’t want to use one of those to be able to send messages to my linux workstations so I cobbled together a simple network popup app with python. (more…)

Tags:
18th October
2008
written by Nick Anderson

Python seems to keep growing on me. By no means am I a Python master, nor am I a vim guru but I do prefer to use vim over a gui editor. Sure there are some niceties with using a gui but getting comfortable using a tool that is almost always at your disposal has something to be said for it. Adding a few things to your vim environment will make writing python much more pleasurable. (more…)

BLOGROLL

ARCHIVE