вторник, 17 августа 2010 г.

Purging of Old pending Notification & workflow data

SQL> select count(*),status from wf_notifications group by status;
COUNT(*) STATUS
---------- --------
1530 CANCELED
1627 CLOSED
15266 OPEN

SQL> select count(*),status, MAIL_STATUS from wf_notifications group by
2 status, MAIL_STATUS order by status;

COUNT(*) STATUS MAIL_STA
---------- -------- --------
5 CANCELED ERROR
1031 CANCELED MAIL
427 CANCELED SENT
67 CANCELED
1 CLOSED ERROR
40 CLOSED SENT
1586 CLOSED
1 OPEN ERROR
1131 OPEN MAIL
3101 OPEN SENT
11033 OPEN



update wf_notifications
set mail_status = 'SENT'
where status = 'OPEN';


commit;


$FND_TOP/sql/wfrmitms.sql (to delete status information in Oracle Workflow runtime tables for a particular item type),
$FND_TOP/sql/wfrmitt.sql (to delete all data in all Oracle Workflow design time and runtime tables for a particular item type).
and $FND_TOP/sql/wfrmall.sql (to delete all data in all Oracle Workflow design time and runtime tables for all item type).

среда, 11 августа 2010 г.

An almost invisible ssh connection

An almost invisible ssh connection
----------------------------------

In the worse case if you have to ssh on a box, do it every time
with no tty allocation

ssh -T user@host

If you connect to a host with this way, a command like "w" will not
show your connection. Better, add 'bash -i' at the end of the command to
simulate a shell

ssh -T user@host /bin/bash -i

Another trick with ssh is to use the -o option which allow you to
specify a particular know_hosts file (by default it's ~/.ssh/know_hosts).
The trick is to use -o with /dev/null:

ssh -o UserKnownHostsFile=/dev/null -T user@host /bin/bash -i

With this trick the IP of the box you connect to won't be logged in
know_hosts.

Using an alias is a good idea.


Erasing a file
--------------

In the case of you have to erase a file on a owned computer, try
to use a tool like shred which is available on most of Linux.

shred -n 31337 -z -u file_to_delete

-n 31337 : overwrite 313337 times the content of the file
-z : add a final overwrite with zeros to hide shredding
-u : truncate and remove file after overwriting

A better idea is to do a small partition in RAM with tmpfs or
ramdisk and storing all your files inside.

Again, using an alias is a good idea.


The quick way to copy a file
----------------------------

If you have to copy a file on a remote host, don't bore yourself with
an FTP connection or similar. Do a simple copy and paste in your Xconsole.
If the file is a binary, uuencode the file before transferring it.

A more eleet way is to use the program 'screen' which allows copying a
file from one screen to another:

To start/stop : C-a H or C-a : log

And when it's logging, just do a cat on the file you want to transfer.


Changing your shell
-------------------

The first thing you should do when you are on an owned computer is to
change the shell. Generally, systems are configured to keep a history for
only one shell (say bash), if you change the shell (say ksh), you won't be
logged.

This will prevent you being logged in case you forget to clean
the logs. Also, don't forget 'unset HISTFILE' which is often useful.


Some of these tricks are really stupid and for sure all old school
hackers know them (or don't use them because they have more eleet tricks).
But they are still useful in many cases and it should be interesting to
compare everyone's tricks.