Wednesday, October 22, 2014

bash: redirect stdout and stderr for a block of "code"

(I was hesitant to call "code" a bash script, as it's mostly molasses of un-refactorable hieroglyphs)

vi redirtest.sh

{
plutti
plitti
} > plutti.log 2>&1

{
pippi
} > pippi.log 2>&1


{
echo ciao
} > ciao.txt

{
echo miao
} > miao.txt



The command "plutti" and "plitti" don't exist, so I will have an error "./redirtest.sh: line 2: plutti: command not found ./redirtest.sh: line 2: plitti: command not found".
But only that block will be redirected to plutti.log.
Same story for pippi.log: you have 2 separate error logs for the 2 blocks of code.
So, not necessarily redirection has to be at the whole script level, or at the single statement level.... one can group several statements in a "try/catch" block, which is cool...IMHO at least, it gives more flexibility ...

Tuesday, October 21, 2014

WebLogic password change

quick miscellaneous notes on the topic... it's VERY easy to get the procedure wrong... http://middlewaremagic.com/weblogic/?p=323

BEA-090078 User weblogic in security realm myrealm has had 5 invalid login attempts, locking account for 30 minutes.
See also: Problem Resetting the Weblogic User Password (Doc ID 1589360.1)

Tried to reset the weblogic users password with these steps:
  a. Stopped Weblogic Server instance.
  b. Make a backup of the LDAP folder of the admin server as well as managed
  c. Set your environment variables by running setDomainEnv.sh (UNIX):. ./setDomainEnv.sh
  e. cd to security directory in your instance.(eg: $WL_HOME/user_projects/domains/base_domain/security)
  d. Run: java weblogic.security.utils.AdminAccount weblogic password .
  e. After running the command, the file “DefaultAuthenticatorInit.ldift” will get updated.
  f. Delete the following file from “ldap” folder: DefaultAuthenticatormyrealmInit.initialized
  g. Edit the boot.properties file and change the password to the value already used on step d.

Started NodeManager and WebLogic Server. Log files show ‘Running’ but can not 
display the WLS Admin Console log in Screen.
Changes
 Updated the password for the weblogic user.

Run:
java weblogic.security.utils.AdminAccount weblogic hello .

Don’t forget the period “ .” at the end of the above command, it is required

Remember also
Reset the node manager password in WLS Admin Console. 
Reference the note: WebLogic - Getting exception in WLST "weblogic.nodemanager.NMException: 
Access to domain for user denied" (Doc ID 889842.1)
  A. Log in to the WLS Admin Console
  B. In the Domain Structure navigation window of the left click on the Domain name.
  C. Click on the 'Security' link on the right hand side
  D. Click the Advanced link near the bottom
  E. Update the 'NodeManager Password' to be the new password you created for weblogic > Save.


Sunday, October 19, 2014

Book: Jenkins, the definitive guide



This is a great reading, the book covers not only Jenkins, but also the vast ecosystem around Continuous Integration (maven, nexus..); all in a very readable way, without indulging too much in the gory details.

It's even downloadable for free from the above Wakaleo URL. Have fun!