Tag Archives: DevOps

chef attribute : avoiding “undefined method `[]’ for nil:NilClass” error

In chef, when a nested attribute that might not exist/or not crated yet, you can use rescue as a modifier to an if statement. For example, assuming that only some of your nodes have node[‘install_wls’][‘isManaged’]defined: if node[‘install_wls’][‘isManaged’] do the stuff … Continue reading

Posted in ARTICLES, Configurtion management, DevOps, HOWTO | Tagged , , , , | Leave a comment

Linux performance Monitoring Tools

There are a lot of tools used for monitoring the performance in Linux. Here is the list of tools in one image that covers what is monitored by what.  

Posted in DevOps, Monitoring, OperatingSystem | Tagged , , | Leave a comment

Python : Inplace update json and maintain proper order

Some time we have to read one existing json property file and  update some values inplace. If we don’t use proper approach, the update may lead to breaking the json structure in the file. We have to hook the json … Continue reading

Posted in ARTICLES, DevOps, Programming, SCRIPTING, TIPS & T RICS | Tagged , , , | Leave a comment

Send mail using Python’s smtplib module

Python has a built in module to send mail to recipient[s] as to,cc,bcc. Here assumption is that : the smtp is configured in localhost (where the script will run).      

Posted in ARTICLES, DevOps, HOWTO, Programming, SCRIPTING, TIPS & T RICS | Tagged , , , | Leave a comment

Knife remove all recipes from the run_list

There is a simple knife command which can be used to remove all recipes from the run_list of all nodes in a environment. For this you have to create a dummy role like suppose dummy_role. #knife role create dummy_role Once … Continue reading

Posted in ARTICLES, DevOps, HOWTO, TIPS & T RICS | Tagged , , | Leave a comment

Chef – Create encrypted data bag and keep secrets

Sometimes we have to deal with global variables like User passwords, database password, API Keys, middleware boot properties in our chef recipes which shouldn’t be exposed outside. One solution is we have to keep all the secrets in a data … Continue reading

Posted in ARTICLES, DevOps, HOWTO, OperatingSystem, Programming, SCRIPTING | Tagged , , , , | 1 Comment

Chef – Deleting existing attributes

Sometimes we face situation like : May need to remove some persistent attributes which we set a flag after some work is done May be we set some attributes wrong so need to remove and reset the existing attribute. The … Continue reading

Posted in ARTICLES, DevOps, HOWTO, TIPS & T RICS | Tagged , , , , | Leave a comment