Thursday, July 8, 2021

oauthaccesstokens.oauth.openshift.io not found error when installing Cloud Pak for Data 3.5.1 on ROKS

 I had the following error returned when trying to install Cloud Pak for Data 3.5.1 on ROKS:

[root@ibmcloudcli cpd3.5]# bin/cpd-cli install --version 3.5.1 --repo repo.cpd351_wd220.yaml --assembly lite --namespace zen -c ${STORCS} --accept-all-licenses --insecure-skip-tls-verify
[INFO] [2021-07-08 02:44:30-0297] Arch override not found. Assuming default architecture x86_64
[ERROR] [2021-07-08 02:44:31-0596] Error verifying current oauth token - Error from server (NotFound): oauthaccesstokens.oauth.openshift.io "sha256~8tVNTfNxXyQutCtTA3KwM8wKJk7JBNZF42h88" not found

[INFO] [2021-07-08 02:44:31-0596] cpd cannot verify token expiry time due to above error
Do you wish to continue (Y/N): n

 

I was able to get around the issue by adding "--silent-install"

Wednesday, August 9, 2017

/bin/rm: Argument list too long error

Today I found the following error returned by linux

[root@server1 cur]# rm *
-bash: /bin/rm: Argument list too long

After quick searching around I found how to remove files in case if there are too many files in the current directory:

find . | xargs rm

That allowed me to delete all files in that dir.

Thursday, April 7, 2016

How to grab collection list from IBM Watson Explorer

There is an easy way to get the list of collections from IBM Watson Explorer

OUT=$(curl -s "http://$HOST:$PORT/vivisimo/cgi-bin/velocity?v.username=$USER&v.password=$PWD&v.function=search-collection-list-xml&v.indent=true&v.app=api-rest")

echo $OUT > out2
COLLIST=$(xmllint --xpath "//vse-collection[starts-with(@name,'mycollection')]/@name" out2 | sed 's/name="//g' | sed 's/"//g')

COLLIST will return all collections which start with "mycollection"
You can further work on the list by using the following as an example:

for col in $COLLIST; do
getStatusFunction $col $PORT
done


Tuesday, October 27, 2015

How to make picture via face camera on macos?

If you would like to make a picture on your macbook, you can use face camera. It is quite easy - you just need to start "photo booth" software and make a picture. It will be saved in "Pictures" folder, so you can download them from there and use them as you would like.

Thursday, October 15, 2015

How to execute fixup or compact on macos?

How do you execute a local Fixup or Compact on Mac OS X running an IBM Notes client? Because there is no ncompact or nfixup executable on Apple Mac OS X, you will have to do it a bit different.

I do not use it often, but I always have to search for it...
- Open a Terminal Window
- Switch to the Notes App Directory:
  cd /Applications/IBM\ Notes.app/Contents/MacOS
- Set the environment variable DYLD_LIBRARY_PATH:   
  export DYLD_LIBRARY_PATH="/Applications/IBM Notes.app/Contents/MacOS"
- Switch to the Support subfolder:
  cd Support
- Execute NotesFixup or NotesCompact:
  ./NotesCompact
  ./NotesFixup

(without options you will do a compact for all databases in your Lotus Notes Data directory
/Users/YourUsername/Library/Application Support/Lotus Notes Data/ )
  ./NotesCompact mail/your-replica.nsf -c

(or with options for a special database)

Friday, October 2, 2015

db2 xml update command

Recently I needed to update db2 column based on XML extract from another field. By surprise, this is not documented very well. Here is how you can do it using SQL statement - make sure your db2 level is 9+:

       
update ibmcom.docstore set language = XMLCAST ( XMLQUERY('$c/externalMetaData/field[@name="Language"]/text()' passing EXTERNAL_METADATA as "c") AS VARCHAR(5))
       
 



Note that this script extracts XML node from XML field, which in my case looks similar to this:
<externalMetaData><field name="ContentType">text/html</field><field name="docid">http://www.blablabla.com/support?uid=2414412</field><field name="documentSource">pushAPI</field><field name="Language">en</field><field name="keywords">websphere</field><field name="Charset">UTF-8</field><field name="scopes">my</field></externalMetaData>

The language field is then extracted from XML and stored in appropriate column. The real trick is in the XMLCAST function, as if you do not use it, the UPDATE statement will fail.

Saturday, June 27, 2015

How to replace substring in linux

There is an easy way to do a mass replace of substring in linux. You can use perl command and a combination of "find/xargs/perl" like this:

find -name '*.log' -type f -print0 | xargs --null perl -pi -e 's/redhat/SUSE/'

The you can tweak the first part of the command (find) to point it to the files which have to be changed. redhat will be replaced with SUSE for all log files in this case.