Sunday, August 31, 2008

Create a new Mac OS X adminstrator account without an existing administrator password

http://www.rit.edu/its/services/desktop_support/mac/xforcenewadminacccount.html

Create a new Mac OS X adminstrator account without an existing administrator password

With access to the Mac OS X single user mode, you can create a new administration-level user account without entering a current administrative password. This process is useful for technical support and troubleshooting, but it does have important security implications.

The following process should be used only as a last resort, when none of the administrator-level accounts on the computer are functional. If you are providing technical support, you should only create a new administrator account in this manner if you have permission from the computer&rsquos owner or system administrator.

In most cases, you can do what is necessary using an existing administrator account. You may need to Change your Mac OS X account password in System Preferences. Or, if the password is not known or forgotten, you can Change a forgotten Mac OS X account password by starting up from any Mac OS X install disc.

Note: Being able to start up a computer in this way and create a new administrator user is a security risk. If you want to prevent the computer from starting up in single user mode or from a Mac OS X install disc, you should enable an Open Firmware password on the computer.

  1. Restart the computer in Mac OS X single user mode by holding Command-S at startup.
  2. Mount the computer's drive for read/write access. To do so, type the following command at the command prompt, and then press Enter:

    % mount -uw /

  3. Remove the file that identifies that the initial run of the "Mac OS X Setup Assistant" has been completed, with this command at the command prompt, followed by Enter:

    % rm /var/db/.applesetupdone

  4. Restart the computer by entering this command, followed by Enter.

    % reboot

  5. The Mac OS X Setup Assistant screen should appear after the reboot, just as it does when you start up a brand new computer or upgrade to a new version of Mac OS X.
  6. Create a new user account with the Setup Assistant. Be sure to name this user something different than the admin user that already exists on the system, and use a strong password (see "Mac OS X password tips"). At the end of the Setup Assistant process, the system will automatically log into this new user account. The account will have a unique ID (UID) that is one higher than the last user that was on the system, and will have all administration privileges.

We strongly recommend that you delete the new administrator account in the System Preferences application, once you have done what you need to do with it and it is no longer needed.

Wednesday, August 27, 2008

VBA WScript Javascript COM Objects

http://hpcgi1.nifty.com/kenzo30/b_cbbs/cbbs.cgi?mode=al2&namber=30099&rev=&no=0&P=R&KLOG=196

CreateObject("InternetExplorer.Application")→Microsoft Internet Controls
CreateObject("Word.Application")→Microsoft Word x.0 Object Library
CreateObject("Outlook.Application")→Microsoft Outlook x.0 Object Library
CreateObject("Scripting.FileSystemObject")→Microsoft Scripting Runtime
CreateObject("Scripting.Dictionary")→Microsoft Scripting Runtime
CreateObject("Shell.Application")→Microsoft Shell Controls And Automation
CreateObject("VBScript.RegExp")→Microsoft VBScript Regular Expressions 5.5
CreateObject("WScript.Shell")→Windows Script Host Object Model

Monday, August 18, 2008

Extract Oracle Object DDL


set long 5000
select dbms_metadata.get_ddl('OJBECT_TYPE','OBJECT_NAME','OWNER') from dual;

Tuesday, August 12, 2008

Dump block header

http://www.insight-tec.com/mailmagazine/ora3/vol025.html

ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME FILE_HDRS LEVEL 10';

Simplest RMAN Backup and Recovery


CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'C:\oracle\orabackup\orcl10\%d_%u_%s_%p';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'C:\ORACLE\PRODUCT\10.2.0\DB_1\DATABASE\SNCFORCL10.ORA'; # default


backup database plus archivelog delete input;

sql 'shutdown immediate';
sql 'startup nomount';
restore database;
recover database;
sql 'alter database';
# sql 'alter database open resetlogs';