Thursday December 03, 2009
TOTD #114: How to enable Java Console in Mac OS X, Windows, ... ?
Debugging an applet running with Java plug-in or JNLP application running with Java Web Start in the browser requires the "Java Console" so that debugging messages printed using System.out and System.err can be seen. In Windows, there is a "Show Java Console" menu item in Firefox but clicking it still does not show the console. And this happens because the console window is disabled by default.
However the setting can be easily altered as explained below.
On Mac OS, open "Applications" -> "Utilities" -> "Java Preferences"
On Windows, open "Control Panel" -> "Java"
On any platform, type "javaws -viewer"
Click on the "Advanced" tab to see a window similar to the following on Mac OS X:

And the following on Windows:

Change the "Java Console" setting from "Hide console" to "Show console". Launching your JNLP from the browser next time now will also open the "Java Console" as shown below:

and debugging messages will be nicely printed in the console. Read more about the options displayed in the console here.
Technorati: osxtips windows java console jnlp debugging totd
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Monday October 19, 2009
MacBook Pro Cycle Count – Too High ?
MacBook Pro Cycle Count means the number of times a battery's entire power is used up. It's formally defined as:
A charge cycle means using all of the battery’s power, but that doesn’t necessarily mean a single charge. For instance, you could use your notebook for an hour or more one day, using half its power, and then recharge it fully. If you did the same thing the next day, it would count as one charge cycle, not two, so you may take several days to complete a cycle.
It can be easily determined by clicking on "Apple", "About This Mac", "More Info...", "Hardware", "Power", "Health Information:". MacBook Pro with a replaceable battery retains 80% of its original capacity after 300 cycles as mentioned here. But in all practical cases, I've heard users replacing the batteries closer to 300 counts. This number goes upto 750 for MacBook Air and 1000 for newer MacBook Pro so there is relief already.
My MBP cycle count hit 283 on Friday and the scary part was "Full charge capacity" was down to 258 mAh. In usage terms, a fully charged battery was getting drained out in 10 minutes :(

A new battery was rushed, installed and the new count is certainly the expected number:

Here are some more relevant docs:
Technorati: osxtips battery cyclecount
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Monday September 28, 2009
TOTD #106: How to install Oracle Database 10g on Mac OS X (Intel) ?
This Tip Of The Day (TOTD) will explain how to install Oracle Database 10g on Mac OS X.
The official documentation is available here and is very well suited for folks with lots of time and patience. But all I wanted was to install Oracle database server up & running on my localhost so that I can start experimenting with it. All my previous entries have used either JavaDB or MySQL so far, but it's about time ;-)
I started preparing a brief tutorial after following the lengthy documentation but then found this excellent blog entry. And realized the content is looking exactly similar :-) Anyway, below are the instructions I followed and additionally also provide a snapshot of the installer windows.
For the brave of heart, complete installation guide is available in HTML and PDF. Read on for an abbreviated, and yet working version, of the instructions.
# dscl . -create /groups/oinstall
# dscl . -append /groups/oinstall gid 100
# dscl . -append /groups/oinstall passwd "*"
# dscl . -create /users/oracle
# dscl . -append /users/oracle uid uid_number
# dscl . -append /users/oracle gid oinstall_gid
# dscl . -append /users/oracle shell /bin/bash
# dscl . -append /users/oracle home /Users/oracle
# dscl . -append /users/oracle realname "Oracle software owner"
# mkdir /Users/oracle
# chown oracle:oinstall /Users/oracle
# passwd oracle
kern.sysv.semmsl=87381
kern.sysv.semmns=87381
kern.sysv.semmni=87381
kern.sysv.semmnu=87381
kern.sysv.semume=10
kernel.shmall=2097152
kernel.sys.shmmax=2147483648
kernel.sys.shmmni=4096
kern.maxfiles=65536
kern.maxfilesperproc=65536
net.inet.ip.portrange.first=1024
net.inet.ip.portrange.last=65000
kern.corefile=core
kern.maxproc=2068
kern.maxprocperuid=2068
and reboot the machine for these parameters to take effect.
export DISPLAY=:0.0
export ORACLE_BASE=$HOME
export ORACLE_SID=orcl
umask 022
ulimit -Hn 65536
ulimit -Sn 65536


~ > sudo /Users/oracle/oraInventory/orainstRoot.sh
Changing permissions of /Users/oracle/oraInventory to 770.
Changing groupname of /Users/oracle/oraInventory to oinstall.
The execution of the script is complete
~ > sudo /Users/oracle/product/10.2.0/db_1/root.sh
Running Oracle 10g root.sh script ...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /Users/oracle/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
export ORACLE_HOME=/Users/oracle/oracle/product/10.2.0/db_1
export PATH=$PATH:$ORACLE_HOME/bin
export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib
Not setting DYLD_LIBRARY_PATH gives the following error:
~ oracle$ lsnrctl start
dyld: Library not loaded: /b/227/network/lib/libnnz10.dylib
Referenced from: /Users/oracle/oracle/product/10.2.0/db_1/bin/lsnrctl
Reason: image not found
Trace/BPT trap
This was not obvious but Googling helped. Make sure to relogin for these changes to take effect. ~ oracle$ lsnrctl start
LSNRCTL for MacOS X Server: Version 10.2.0.4.0 - Production on 28-SEP-2009 14:48:49
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Starting /Users/oracle/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for MacOS X Server: Version 10.2.0.4.0 - Production
System parameter file is /Users/oracle/oracle/product/10.2.0/db_1/network/admin/listener.ora
Log messages written to /Users/oracle/oracle/product/10.2.0/db_1/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dhcp-usca14-133-197.SFBay.Sun.COM)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
TNS-12560: TNS:protocol adapter error
TNS-00515: Connect failed because target host or object does not exist
MacOS X Server Error: 49: Can't assign requested address
Listener failed to start. See the error message(s) above...
# listener.ora Network Configuration File: /Users/oracle/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /Users/oracle/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /Users/oracle/oracle/product/10.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
# tnsnames.ora Network Configuration File: /Users/oracle/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
The changes are highlighted in bold. And here as well change the value of HOST key to "localhost". ~ oracle$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Sep 28 17:44:40 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 612368384 bytes
Fixed Size 2085872 bytes
Variable Size 167775248 bytes
Database Buffers 436207616 bytes
Redo Buffers 6299648 bytes
SQL> alter database mount;
Database altered.
SQL> alter database open;
Database altered.
SQL> ALTER USER HR IDENTIFIED BY hr ACCOUNT UNLOCK;
User altered.
SQL> exit
Disconnected from Oracle Database 10g Release 10.2.0.4.0 - Production
The last step of unlocking the account should not be required because we explicitly unlocked the account during installation but that apparently didn't work. And I hit ORA-01033, ORA-01034, ORA-12514, ORA-12541, ORA-12547, and ORA-27101 trying different combinations to get the app working.
~ oracle$ sqlplus hr/hr@orcl
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Sep 28 17:46:19 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Release 10.2.0.4.0 - Production
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------
REGIONS
LOCATIONS
DEPARTMENTS
JOBS
COUNTRIES
EMPLOYEES
JOB_HISTORY
7 rows selected.
SQL> desc regions;
Name Null? Type
----------------------------------------- -------- ----------------------------
REGION_ID NOT NULL NUMBER
REGION_NAME VARCHAR2(25)
SQL> select * from regions;
REGION_ID REGION_NAME
---------- -------------------------
1 Europe
2 Americas
3 Asia
4 Middle East and Africa
A complete archive of all the tips is available here.
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Wednesday April 30, 2008
OSX #8: Java SE 6 U5 on Mac OS X Leopard
Yesterday, Apple released
Java SE version 1.6.0_05 for 64-bit Intel-based Mac OS X 10.5.2 or
later. Download
it here!
It's restricted to 64-bit machines and Charles
is unhappy about it. Hopefully, they'll release a 32-bit
version as well.
Type "sw_vers" in a terminal to check the Mac OS X version as shown
below:
| ~
>sw_vers ProductName: Mac OS X ProductVersion: 10.5.2 BuildVersion: 9C31 |



| /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin
>./java -version java version "1.6.0_05" Java(TM) SE Runtime Environment (build 1.6.0_05-b13-120) Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_05-b13-52, mixed mode) |
| /Applications/Utilities/Java/Java Preferences.app/Contents/MacOS >./"Java Preferences" |

Posted by Arun Gupta in General | Comments[1]
|
|
|
|
|
Tuesday January 15, 2008
OSX #7: Upgrading Mac OS X from Tiger to Leopard
![]() |
Did you buy a new or refurbished Macintosh computer on or after Oct
1, 2007 ? And it does not have Mac OS v10.5 Leopard ? And would like to upgrade ? And save money ? See if you qualify (new or refurbished). If you do, then you can upgrade using a Single-User Upgrade Kit at the cost of $9.95. This offer expires Jan 26, 2008. Read more details in Mac OS X Leopard Up-to-Date Program. |
I ordered mine last week, got the delivery in 3 days and upgraded this morning. Really simple! Now I'm using Mac OS v10.5 Leopad on my MacBook Pro :)
A complete archive of all Mac OS X tips on this blog are available here.
Technorati: mac osxtips tiger leopard
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Friday January 04, 2008
OSX #6: Organizing your Dock & Dashboard
Dock
is the Windows Start Bar equivalent in MacOS. However if a program is
installed on your MacBook, unlike Windows, you'll need to
explicitly add it to the Dock.
To add an icon to Dock:
Just click on the Finder icon in Dock,
,
locate the installed program and drag/drop the icon to Dock. This can
be done from the Desktop as well.
To remove an icon from
Dock: just drag it away from the Dock onto the desktop;
the icon will disappear in a poof of smoke 
Dashboard
is Windows Sidebar equivalent in MacOS - it is used for hosting widgets
and activated by the default keyboard shortcut of F12.
| To add widgets to Dashboard: Some common widgets are included with the OS itself and can be enabled by clicking on the + button in left-bottom corner of the screen when Dashboard is visible. More widgets can be downloaded from here or by clicking on +, "Manage Widgets..." and "More Widgets...". | ![]() |
A complete archive of all Mac OS X tips on this blog are available here.
Technorati: mac osxtips dock dashboard widgets
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Wednesday December 26, 2007
OSX #5: Alt-Tabbing in Mac (Switching between windows on Mac)
Alt-Tabbing in Windows shows currently open windows and allows to select one of them which then becomes the active window. If there are 3 Firefox windows, then it'll show 3 icons. A slightly different behavior is available in Mac where it shows one icon for all the open windows of an application and then provide a different keyboard shortcut to switch between all the windows of that application.
Switch between different applications: Command+Tab (for example if you have Firefox, Thunderbird and other applications). Shift+Command+Tab moves in the reverse direction.A complete archive of all Mac OS X tips are available here.
Posted by Arun Gupta in General | Comments[6]
|
|
|
|
|
Monday December 24, 2007
OSX #4: How to forcibly kill an application on Mac ?
The Task Manager in Microsoft Windows is multipurpose. However the most
common use, IMHO, is to kill a misbehaving application or that is "Not
Responding". This is called as "Force Quit" on Mac and can be
achieved by calling Command+Option+Esc which brings up a window like:

Then you select the application that you would like to shutdown and
click on "Force Quit" button. As in Windows, you will loose any unsaved
data.
A complete archive of all Mac OS X tips are available here.
Posted by Arun Gupta in General | Comments[2]
|
|
|
|
|
Sunday December 23, 2007
OSX #3: How to eject CD/DVD in Mac ?

A complete archive of all Mac OS X tips are available here.
Posted by Arun Gupta in General | Comments[1]
|
|
|
|
|
Friday December 21, 2007
OSX #2: How to capture screen on Mac ?

A complete archive of all Mac OS X tips on this blog are available here.
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Thursday December 20, 2007
OSX #1: Getting Started with a Mac for a Windows User
![]() |
I got a new Apple MacBook Pro (Intel Core 2 Duo, 2GB RAM, 160 GB HDD and other good stuff) and excited about that! However I've been a Windows user all along and this is my first interaction with a Mac. |
So here are some basic tips/tools to get you started if you are in the same situation:
Forward Delete key, Mac
equivalent is Fn + Delete Home, Page
Up or Page Down keys, Instead
use Fn + Cursor keys The box came installed with Tiger (Mac OSX 10.4) as opposed to Leopard (Mac OS X 10.5). Leopard Updates are available for $9.95 until Jan 4th, 2007.
Some other striking difference in the terms of UI are:
Here are some other tasks that I tried:
These tips will at least get you started where you can check Email, IM and Web, view your documents, import key settings from Firefox/Thunderbird and unleash the potential of GlassFish and NetBeans. Lots of other tips are available here, here and here. I'll post more as I learn them. Feel free to post your favorite tool/tip/guidance here.
A complete archive will be available here.
Technorati: windows mac apple tools osxtips
Posted by Arun Gupta in General | Comments[3]
|
|
|
|
|
Today's Page Hits: 582
Total # blog entries: 1025