How to configure a Shared Library in WebSphere with Jython

Here's a script that I used to configure a Shared Library in WebSphere 6.1 using Jython. [sourcecode language="python"] from string import whitespace sharedLibName = "APPLICATION_SHARED_LIB" # See if library already exists. cellId = AdminConfig.list("Cell") sharedLibraryId = AdminConfig.list("Library") if (sharedLibraryId.find(sharedLibName) < 0): # Library does not exist. print "Creating Shared Library" params = []; params.append(["name", sharedLibName]); …

Continue reading How to configure a Shared Library in WebSphere with Jython

How to configure WebSphere Global Security to use LDAP with Jython

Here's a script that I used to configure the WebSphere 6.1 global security setting to use LDAP using Jython. [sourcecode language="python"] # Properties username = "user" password = "pass" ldapServer = "somecompany.com" ldapPort = "389" # Configure the LDAP authentication AdminConfig.save(); # This needs to happen so you can write to the Security file. ltpa …

Continue reading How to configure WebSphere Global Security to use LDAP with Jython

Finding line count in DOS

In Unix, there's this nifty binary called "lc" which gives you the line count of the file. However, in DOS, you have to be a little more creative. Below is a DOS command I use to count the number of lines in a text file. [sourcecode language="text"] FIND /v /c "nonsense" filename.ext [/sourcecode] The "nonsense" …

Continue reading Finding line count in DOS