Python UCM Client

This package provides a simple client for calling the services on Oracle Content Server 11g via the standard web interface. It can be used in conjunction with any of the services provided by Content Server defined here

Installation

easy_install ucmclient

Examples

Uploading a file to Content Server

from ucmclient import UcmClient, ServiceFailed

#connect to ucm with specified hostname and content server port
ucmClient = UcmClient(‘ucmserver.example.com’,’16200′)
ucmClient.login(‘weblogic’,'password’)

#build a dictionary of service parameters.
ucmServiceData ={
‘dDocTitle’:'New Article 1′,
‘dDocName’:'News_Article_01′,
‘dDocType’:'News’ Continue reading

The python "with" statement explained with examples.

Python’s with statement was introduced into the language in version 2.5 and is defined in PEP 343. The python docs provide the following description “The with statement is used to wrap the execution of a block with methods defined by a context manager. This allows common try…except…finally usage patterns to be encapsulated for convenient reuse.” but what does this actually mean?

Lets start with an example:

With File

with open(“test.txt”) as testfile Continue reading

Python Split and Join Examples

Split and join in python are similar to the equivalent functions in most dynamic languages with a few minor differences:

Python Split

Split a sentence into separate words:

sentence = “the cat sat on the mat”
print sentence.split()
['the', 'cat', 'sat', 'on', 'the', 'mat']
Split words separated by a single character:

sentence = “the,cat,sat,on,the,mat”
print sentence.split(‘,’)
['the', 'cat', 'sat', 'on', 'the', 'mat']
Split words separated by a string:

sentence = “theSPACEcatSPACEsatSPACEonSPACEtheSPACEmat”
print sentence.split(‘SPACE’)
['the', 'cat', 'sat', 'on', 'the', 'mat']
Split only the first two Continue reading

Reset Mysql Root Password Script

Lost (forgotten) your mysql root / admin password? Not to worry, it happens to the best of us.

This simple BASH password reset script will enable you to reset any mysql user password without knowing the current password

I would not recommend running it on a live production system as it requires shutting down the mysql server.

Heres the script:, it needs to be run as root.

# Kill any mysql processes currently running
echo Continue reading

Go back to top