Category Archives: Code

su – command inside a loop

If you have a script that runs su commands from inside a loop, you might find that the loop terminates silently before all of the iterations are complete. cat $file | while read theline do         … Get the user … Continue reading

Posted in Code, Unix And Shell | Leave a comment

What’s the Truth? IBM WebSphere MQ Deployments

Java guys and other application developers have been doing it for years (decades!) – writing code, storing it in a Source Code Management tool, building it and deploying it through their “route to live”. WebSphere MQ Deployments are a bit of a … Continue reading

Posted in Configuration, MQSC Commands, Release Management | Tagged , , , , , , | Leave a comment

A few useful find commands

Find all files below the current directory not owned by user wasadmin. Get a full listing of the results: /var/websphere/was7/MVProdEnv/AppServer/ > find . ! -user wasadmin -ls Change the ownership of these files: find . ! -user wasadmin -exec chown … Continue reading

Posted in Code, Unix And Shell | Tagged , , , | Leave a comment

Concatenate all lines to one line

Here is something I needed to do the other day. I needed to take an input file which had many lines of text, and concatenate to one line. There are lots of ways of doing this, but here is just … Continue reading

Posted in Code, Unix And Shell | Tagged , , | Leave a comment

Compress logs daily

If you have a service generating log files that can’t be automatically rolled over and cleaned up, here is a quick method,  using a cron entry, to gzip and then remove the unneeded logs: 05 04 * * * /usr/bin/find … Continue reading

Posted in Code, Unix And Shell | Tagged , , , , , , , , , , | 3 Comments

Add a date to an output file generated from a cron entry

If you’ve ever struggled to put a date format in a crontab entry, so that the output file for the command has a date/time stamp, then here is a method that works: 00 02 * * * /var/scripts/bin/filesystem_cleaner.sh -a > … Continue reading

Posted in Code, Unix And Shell | Tagged , , , , , | 3 Comments

Example WebSphere Jython to print help info

The following little code snippet will help print out help info for some WebSphere high level types (AdminTask and AdminConfig : # List AdminTask commands global AdminTask print “AdminTask:” print AdminTask.help(‘-commands’) # List AdminConfig types print “AdminConfig:” print AdminConfig.help(‘types’) print … Continue reading

Posted in Code, Jython for WebSphere | Tagged , , , , , , | Leave a comment

Example WebSphere Jython for Message Listener Service

Modify a Listener Service and optionally add listener ports. Required for this code: CellName, nodeName, appServerOrclusterMemberName See also Convert String to List post for wsadminToList function. server = AdminConfig.getid(“/Cell:”+cellName+”/Node:”+nodeName+”/Server:”+appServerOrclusterMemberName+”/” ) mlsInactivityTimeout = 3500 mlsIsGrowable = “false” mlsMaximumSize = “50″ mlsMinimumSize … Continue reading

Posted in Code, Jython for WebSphere | Tagged , , , , , | Leave a comment

Example WebSphere Jython for work areas

Required for this code: CellName, nodeName, appServerOrclusterMemberName # Application Server – Work Area asWorkAreaEnable = “false” asWorkAreaEnableWebServicePropagation = “false” asWorkAreaMaxReceiveSize = 10000 asWorkAreaMaxSendSize = 10000 server = AdminConfig.getid(“/Cell:”+cellName+”/Node:”+nodeName+”/Server:”+appServerOrclusterMemberName+”/” ) #————————————————————– # Change Work Area settings #————————————————————– if (cmp(asWorkAreaEnable, “true”) == … Continue reading

Posted in Code, Jython for WebSphere | Tagged , , , , , , , | Leave a comment

Example WebSphere Jython for Setting Object Request Broker parameters

Setting Object Request Broker (ORB) for an application server Required for this code: CellName, nodeName, appServerOrclusterMemberName # Application Server – Object Request Broker Settings asORBrequestTimeout = 180 asORBrequestRetriesCount = 1 asORBrequestRetriesDelay = 0 asORBconnectionCacheMaximum = 240 asORBconnectionCacheMinimum = 100 asORBcommTraceEnabled … Continue reading

Posted in Code, Jython for WebSphere | Tagged , , , , , , , , , , , , , , , | Leave a comment