The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

My Music (Nickleus)


jboss jsf login example catalina container managed security j_security_check web.xml login-config auth-method form

some relevant code from web.xml:
<display-name>Web Security</display-name>
<display-name>Admin Web Security</display-name>

the security-role role-names are defined in our LDAP server.

the most relevant line from

WebAuthentication webA = new WebAuthentication();
webA.login(username, password);

 this is done when backend authentication, plus anything you need to check/set before you welcome the user into the application, is complete. note that is declared with request scope in faces-config.xml and the class itself has the annotation @org.ajax4jsf.model.KeepAlive
this redirect should be run on a server using https because it is a GET request.

and some code from login.xhtml:

<h:messages showDetail="false" showSummary="true" layout="list" styleClass="rich-messages-label" /> 
<h:form id="checkPassword">
<h:panelGrid columns="2">
<h:outputLabel for="username" value="#{loginBean.getPropertyValue('label.username')}" />
<h:inputText required="true" id="username" value="#{loginBean.username}" />
<h:outputLabel for="password" value="#{loginBean.getPropertyValue('label.password')}" />
<h:inputSecret required="true" id="password" value="#{loginBean.password}" />
<h:commandButton value="#{loginBean.getPropertyValue('label.login')}" action="#{loginBean.login}" disabled="#{loginBean.mustChangePassword}" reRender="checkPassword,authenticate" />
<h:form id="authenticate" rendered="#{loginBean.mustChangePassword}">
<h:panelGrid columns="2">
<h:outputLabel for="currentpassword" value="#{loginBean.getPropertyValue('label.passwordCurrent')}" />
<h:inputSecret required="true" id="currentpassword" value="#{loginBean.password}" />
<h:outputLabel for="newpassword" value="#{loginBean.getPropertyValue('label.passwordNew')}" />
<h:inputSecret required="true" id="newpassword" value="#{loginBean.newPassword}" />
<h:outputLabel for="confirmnewpassword" value="#{loginBean.getPropertyValue('label.passwordConfirmNew')}" />
<h:inputSecret required="true" id="confirmnewpassword" value="#{loginBean.confirmNewPassword}" />
<h:commandButton value="#{loginBean.getPropertyValue('')}" action="#{loginBean.authenticate}" />


what's the difference between oracle's expdp full database backup (full=y) and not full (default)

e.g. if you are using scott, a non-full dump/export will only dump scott's tables. a full backup will dump scott's tables, but also system tables, etc.

-rw-r----- 1 oracle oinstall  318050304 2012-02-24 09:44 full_11g.dmp
-rw-r----- 1 oracle oinstall  260571136 2012-02-24 09:53 not_full_11g.dmp


how to change oracle table tablespace and rebuild unusable indexes

after installing oracle 11g on ubuntu 11.10, importing (using impdp) from an oracle 10g database, i noticed that some of the tables were in the SYSTEM tablespace instead of the USER tablespace so i wanted to move them all to the same tablespace. you do it in 2 parts, first move, then rebuild indexes. here's how i did it:

* log in as sys:

su - oracle 
cd /u01/app/oracle/product/11.1.0/db_1/bin 
./sqlplus sys as sysdba

* now, to find out which tables were in the SYSTEM tablespace:
select table_name from dba_tables where owner = 'SCOTT' and tablespace_name = 'SYSTEM';
let's say the query returns:
* and to find their index names:
select index_name from dba_indexes where STATUS='UNUSABLE';
(this will technically give you all the unusable index names, or you can narrow your search to the 3 tables above if you like, by modifying the where clause, but why wouldn't you want to see if there were additional unusable indexes? =))

let's say the query returns:

(in my table i had all kinds of different looking index names, e.g.: SYS_C0014766, TABLEX_PK, IX_HTTPMSGFM_MEMBER_LDAP_ID, AGREEMENTNO_UNIQUE, etc -- who the hell named these so inconsistently?)

* move them to USER tablespace, then rebuild the unusable index:
alter table SCOTT.TABLEX move tablespace USERS;alter index SCOTT.TABLEX rebuild tablespace USERS;
alter table SCOTT.TABLEY move tablespace USERS;alter index SCOTT.TABLEY rebuild tablespace USERS;
alter table SCOTT.TABLEZ move tablespace USERS;alter index SCOTT.TABLEZ rebuild tablespace USERS;


how to give oracle user home directory and bash history

after installing oracle 11g on ubuntu 11.10, i'm left with an oracle user that doesnt have a home and who forgets all his command line history. to fix this:
* as a normal user (not oracle) with sudo privileges:
sudo mkdir /home/oracle
sudo chown oracle:oinstall /home/oracle
su - oracle
touch .bash_history


workaround for oracle impdp ORA-39014 ORA-39029 ORA-31672 prematurely exited/terminated

i've been trying for the last 24 hours to import a dump/dmp file created with expdp in oracle 10g on ubuntu 8 into a new server on ubuntu 11.10 with oracle 11g enterprise, using this import statement:
oracle@mydbserver:/u01/app/oracle/product/11.1.0/db_1/bin$ ./impdp scott@MYDB PARFILE=/home/me/Downloads/params.txt

but it would run for a little while then throw this error:
ORA-39014: One or more workers have prematurely exited.
ORA-39029: worker 1 with process name "DW01" prematurely terminated
ORA-31672: Worker process DW01 died unexpectedly.

when i increased the PARALLEL number (e.g. to 4) it got past a place it was stuck at, and got somewhat further.

params.txt looks like this:

another workaround is to import tables one by one using the INCLUDE parameter, so e.g. add this line to the param file (i.e. params.txt):

then simply rerun the impdp command (while in the bin directory):
./impdp scott@MYDB PARFILE=/home/me/Downloads/params.txt

if somehow you know there is a particular table that is causing trouble you can use the EXCLUDE parameter instead and simply exclude that one table:

our dmp file was made while the database was running and thus one of the tables got corrupted, or was exported in the middle of a process so that's why we had problems importing it into the new database. i found this out by doing this:
cat /u01/app/oracle/admin/mydb/dpdump/import.log

which showed me the name of the import job i was running:

so i ran this:

and it showed me which table was the last table to be attempted imported:
Worker 1 Status:
  Process Name: DW01
  State: UNDEFINED                    
  Object Schema: SCOTT
  Object Name: MY_CORRUPT_TABLE1
  Completed Objects: 4

so i knew i should exclude that table in the import.

sources: (thanks to user )

p.s. in some previous desperate attempts to get things to work (prior to the instructions above), i also ran the following as sys:

alter system set open_cursors=1024 scope=spfile;
alter system set "_optimizer_cost_based_transformation"=off;

i cant say for sure whether this was necessary or not. i'm sorry, i know, that sucks, but if the above fails then consider running these alter statements, then trying again.

where is the default oracle impdp log file location?

in my oracle 11g installation on ubuntu 11.10 it is:

i found this folder by running this query:
SELECT directory_path FROM dba_directories WHERE directory_name = 'DATA_PUMP_DIR';


how to exclude multiple files when importing with impdp for oracle xe

su oracle
cd /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin
nano -w params.txt

give it the following content, e.g.:


save it, then run impdp like this:
./impdp system@MYDATABASE PARFILE=params.txt



sox FAIL formats: no handler for file extension `mp3'

if you're trying to work with mp3 files and sox wont play, run this in a terminal:
sudo apt-get install libsox-fmt-mp3

how to quickly get the most updated (svn) version of hydrogen for ubuntu 11.10

i've noticed a couple of bugs in hydrogen 0.9.5:
* metronome indiscriminately turning on/off during playback and export
* incorrect error message when exporting, that it failed when it didnt fail

there might be more bugs, but the 2 bugs above have at least been fixed. to get the latest and most up-to-date version of hydrogen do this in a terminal:
sudo add-apt-repository ppa:kxstudio-team/hydrogen
sudo apt-get update
sudo apt-get install hydrogen-svn



how to install raid on ubuntu 11.10

*you need the server edition*--the normal desktop version doesnt have raid options in the manual partitioning interface.

then follow this:

then after choose "configure software raid"


how to backup the oracle 10 database using expdp

to backup the database using expdp:
cd ~/path/to/oracle/product/10.2.0/db_1/bin
./sqlplus "sys/any as sysdba"
SQL> startup;
SQL> exit;
./lsnrctl start
./sqlplus "sys/any as sysdba"

if you already havent done so:
SQL> grant read, write on directory DATA_PUMP_DIR to scott;

now run:
SQL> host

$ ./expdp scott/mypassword DIRECTORY=DATA_PUMP_DIR DUMPFILE=expdat_scott.dmp

the backup dmp file will be here:

which is the default value/location for DATA_PUMP_DIR

you can double check it in sqlplus like this:
SELECT directory_path FROM dba_directories WHERE directory_name = 'DATA_PUMP_DIR';

source: (external link)

how to delete oracle 10 archive log redo files

when trying to connect to my database i got this error:
oracle: ORA-00257: archiver error. Connect internal only, until freed.


to double check the archivelog redo space:
cd ~/path/to/oracle/product/10.2.0/db_1/bin
./sqlplus "sys/any as sysdba"
SQL> archive log list;
SQL> show parameter db_recovery_file_dest;

source: (external link)

in another terminal:
cd ~/path/to/oracle/product/10.2.0/db_1/bin
./rman target / nocatalog

RMAN > delete archivelog all;

source: (external link)

it seemed as if things werent quite deleted so i ran this:
RMAN > run {
allocate channel t1 type disk;
backup archivelog all delete input format '/home/oracle/arch_NaVu_%s';
release channel t1;



samsung galaxy gio GT-S5660 mobile cell phone android 2.3.3 how to transfer call / set someone over

when you get a call you want to set over to someone else's telephone (transfer) push the "keypad" button, then type:

e.g. to transfer the incoming call to 22 22 22 22, type:


ubuntu 11.10 configure multiple desktops, laptop to external monitor with hdmi cable

in ubuntu 11.10 unity, in order to connect my laptop to an LG flatron L246WH monitor that i've rotated to the left so it stands tall, on its side, you have to first enable ubuntu's fglrx driver using jockey-gtk. then open system settings > displays, then select the goldstar company ltd 24" monitor and choose rotation: clockwise. (note: these settings get saved in ~/.config/monitors.xml)

then every time you switch between single and dual desktop mode you have to (at least when switching back to dual mode) go into displays again and set it up.

to automate this process, i made a script i use in a terminal to quickly and easily switch between single and dual desktop mode, called xto:

put the script here:

make sure you set it to executable:
chmod +x ~/xto

to set system to dual mode:
cd./xto -m

to set system to single desktop mode:
cd./xto -s

below are the configuration files for single and desktop modes that the script copies to set things up, depending on the command line arg you send to xto.


place these files in ~/Documents