maldito.orco Blogo

Wednesday, August 20, 2008

Script to Shutdown a OAS instance with status info

This pair of scripts (shutdown/startup) of Oracle Application Server (OAS) realize the task together. The shutdown script store the OC4Js status prior shutdown opmn.

The startup script, start opmn and each OC4J stored on shutdown. (plus OHS).

Its really simply, to give us a framework where initial start our work.

enjoy!.


shutdown_OAS.sh
===============
#!/bin/bash
#

if [ "_${1}" = "_" ]; then
echo "Error: el script necesita de un ORACLE_HOME de un OAS como parametro de entrada"
exit 1
fi

OH=$1
ORACLE_HOME=$1
PATH=$OH/bin:$OH/opmn/bin:$OH/dcm/bin:$OH/OPatch:$OH/jdk/bin:$PATH

if [ ! -d $OH ]; then
echo "Error: el ORACLE_HOME=$OH no es un directorio valido"
exit 1
fi

if [ ! -x $OH/opmn/bin/opmnctl ]; then
echo "Error: no se encontro el ejecutable ORACLE_HOME/opmn/bin/opmnctl"
exit 1
fi

##
## seteo instance name
INAME=`opmnctl status | grep "Processes in Instance:" | awk '{print $4}' | awk -F. '{print $1}'`
##
## obtengo lista de oc4js activos
OC4J_ACTIVE_LIST=`grep "process-type" $ORACLE_HOME/opmn/conf/opmn.xml | grep OC4J | grep --invert-match "disabled" | awk '{ print $2 }' | awk -F= '{ print $2 }' | awk -F\" '{ print $2 }'`
##
## vaciar archivo
$INAME.oc4jalive.txt
##
## iterar cada uno de la lista de enableds del opmn.xml viendo si esta Active en el status
for i in $OC4J_ACTIVE_LIST; do
STATUS=`opmnctl status -fmt %prt%sta | grep -e "\(OC4J:\)\?$i " | uniq | awk '{print $3}'`
echo ST=$i[$STATUS]
if [ "$STATUS" = "Alive" ]; then
echo $i >> $INAME.oc4jalive.txt
fi
done
##
## bajo OAS
opmnctl shutdown
##
## si es un R2 y esta el comando emctl bajo aparte la consola
if [ -x $OH/bin/emctl ]; then
emctl stop iasconsole
fi

startup_OAS.sh
==============
#!/bin/bash
#

if [ "_${1}" = "_" ]; then
echo "Error: el script necesita de un ORACLE_HOME de un OAS como parametro de entrada"
exit 1
fi

OH=$1
ORACLE_HOME=$1
PATH=$OH/bin:$OH/opmn/bin:$OH/dcm/bin:$OH/OPatch:$OH/jdk/bin:$PATH

if [ ! -d $OH ]; then
echo "Error: el ORACLE_HOME=$OH no es un directorio valido"
exit 1
fi

if [ ! -x $OH/opmn/bin/opmnctl ]; then
echo "Error: no se encontro el ejecutable ORACLE_HOME/opmn/bin/opmnctl"
exit 1
fi

##
## start opmn process
opmnctl start
##
## seteo instance name
INAME=`opmnctl status | grep "Processes in Instance:" | awk '{print $4}' | awk -F. '{print $1}'`
##
## iterar cada componente levantandolo
for i in `cat $INAME.oc4jalive.txt`; do
opmnctl startproc process-type=$i
done
##
## carga del OHS
opmnctl startproc process-type=HTTP_Server
##
## carga del dcm-daemon (solo para R2, en R3 da error)
opmnctl startproc ias-component=dcm-daemon
##
## si es un R2 y esta el comando emctl bajo aparte la consola
if [ -x $OH/bin/emctl ]; then
emctl start iasconsole
fi









Labels: , , , ,

Thursday, August 07, 2008

I try to activate MP3 profile on "Output Format" (on Sound Juicer) or "Preferred Format" (on Rhythmbox) without success.

I'm using Ubuntu 8.04, upgrade from 7

The only thing I need to do was:

apt-get install gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse

I get help from:
http://ubuntuforums.org/showthread.php?t=957&page=5

"Originally Posted by Jacob Bezemer View Post
Ubuntu: Ripping in mp3 with id3 tags
By default, ubuntu does not come with this enabled. To add functionality to rip mp3's in ubuntu with sound juicer with id3 tags, lets do the following.

1. Install the necessary gstreamer packages:
# apt-get install gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse
2. Load sound juicer, go to Edit->Preferences
3. Under Format, choose Edit Profiles, and click New.
4. For Profile name, pick mp3 and hit Create.
5. Then click on the mp3 profile and click Edit.
6. Change the gstreamer pipeline to the following:
audio/x-raw-int,rate=44100,channels=2 ! lame name=enc ! id3mux
7. Then set the File Extension to "mp3".
8. Click on the checkmark box "Active?" then click Ok.
9. Hit Close on the Edit profiles screen.
10. You will need to exit the sound juicer application and restart it.
11. After reloading sound juicer, go back to Edit->Preferences and under the Output format section, you will now be able to set the newly created mp3 profile you created.

This will create mp3 files with a bitrate of 128 kb/s. Now stick in your cd's and you should be ready to go! If you are using another cd extracting program which uses gstreamer, this functionality should work fine as you just added a new gstreamer profile to the system, not specifically to sound juicer.
Tested under dapper."


Thxs Ubuntu Forum and Community!!

Labels: , , , , , ,