Mac keeps showing popup dialog asking password for Local Items in keychain after upgrading to Mavericks

For those having issue with keychain asking for "Local Items" every time after upgrading to Mavericks, and not being able to unlock the keychain lock (asks again for the same unknown password)

Don't even try to repair (it will not work) or Reset my Default Keychain (it will ask for the password). 

Fixes: Go to ~/Library/Keychain and move all files to the trash. Reboot your mac and keychain should give you a message of error, just click to create new keychain. 

https://discussions.apple.com/message/23496232#23496232

Upgrading Mac RAM

I have Virtualbox running CentOS on my Mac, on which i have Oracle XE running (since there`s no Oracle XE for Mac). In addition to that, I have Eclipse, SQL Developer, Chrome, Firefox (both with gwt plugin) running. With only 4GB of RAM, this set up brought my Mac its knees.

I clearly needed to upgrade my RAM.

I notice that Mac has 4 memory slots. 2 are already occupied by default by 2 memory modules, each 2 GB. I bought another 2 modules, each 4 GB, tried to insert them to the vacant slots... and it works! Now i have 12 GB RAM.

RAM manufacturers may vary, but keep frequency (mine is 1333 MHz) the same.


Installing Oracle Express 11g on CentOS

I tried to install Oracle Express 11g on CentOS following steps in this blog:

http://www.davidghedini.com/pg/entry/install_oracle_11g_xe_on

I installed successfully but i was unable to connect to the database. It kept giving me error:

ORA-01031: insufficient privileges

I found the answer in this forum: http://www.orafaq.com/forum/t/169798/0/

Summary:

yum install libaio bc flex net-tools
add your hostname to /etc/hosts
unzip oracle.zip
cd Disk1
rpm -ivh oracle.rpm
/etc/init.d/oracle-xe configure
usermod -a -G dba username (replace username with any username to access db)

all above must be run as root.

And then add envvar ORACLE_HOME and ORACLE_SID to user's ~/.bash_profile (case sensitive!)

export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE

Also add oracle bin to the PATH:

PATH=$PATH:/u01/app/oracle/product/11.2.0/xe/bin

Restart, and now i can log in into sqlplus this way:

sqlplus / as sysdba

I tried to connect to db as user system with the password supplied during oracle-xe configure after installation, i get nasty error saying password invalid. I have to log in as sysdba and set the password of the user system (used in APEX):

alter user system identified by password

And now, setting ssh so i can access my centos from mac.
First check if sshd is already started and listening to port 22:

sudo netstat -tulpn | grep :22

If sshd is already started, then you should see sshd listed there, listening on port 22. If nothing shows up, then start sshd as root:

chkconfig sshd on
service sshd start

Add the following to /etc/sysconfig/iptables if not already present

-A input -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

And restart iptables

service iptables restart

To connect with SSH from mac host to centos guest virtualbox, activate adapter 2 in virtualbox -> settings -> network.

http://aruljohn.com/info/virtualbox-access-guest-from-host-nat/

Choose host only adapter for adapter 2. In the name drop down list, if none is already present, create one from virtualbox preference.

When this is done, run ifconfig as root from inside centos to find out the ip address to connect to. In my case, the ip address is 192.168.56.102.

Now i can ssh to my centos from my mac.

Open port for Application Manager/Apex and ORCL db. These ports are defined in oracle-xe configure after installation. Add entries in iptables (in my case, apex at 10001 and ORCL db at 1521):

-A input -m state --state NEW -m tcp -p tcp --dport 10001 -j ACCEPT
-A input -m state --state NEW -m tcp -p tcp --dport 1521 -j ACCEPT

Restart iptables:

service iptables restart.

Now i can access oracle db (thru SQL developer) and apex (http://192.168.56.102:10001/apex/f?p=4950) from my mac.

On a related thread, another story...
My mac has a meager RAM of only 4GB. I allocated 1 GB to the centos on virtualbox and when i fire up eclipse, firefox, and sql dev on mac host and oracle db on centos gues, my mac goes down to its knees.

I tried to prune the memory allocated to centos to half its installation size. centos still runs well, but ORCL would not start complaining:

ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist.

I tried to fiddle with SGA resizing (init.ora) but none works. I decided to do a fresh reinstall of centos and ORCL.

This time, i created centos virtual machine with RAM 512.

I booted it with centos live CD iso. When i get to the desktop, i clicked "install to hard disk" icon. But nothing happened. I learned later that centos would not install thru GUI at 512 MB RAM. So i had to sudo and run the executable symlinked by the install to hard disk icon.

I got a centos installation without GUI. Oracle installation succeeded, but sqlplus would not start with error message of inssuficient permission. I would be happy to have CLI centos and lean ORCL on it, but i simply did not have time to fiddle to get it to work. So i decided to reinstall centos with 768 MB. GUI installation worked, and i get to the above steps.

I will try to find out what cause ORCL to refuse to start when in centos no GUI mode. When i have time. Which is very likely never going to happen. .-))

How to install a jar manually in local maven repository


Problem Statement: Your pom.xml dependencies is not able to download a certain jar from the repository.
Solution:
You can manually download the jar and add it to your local maven repository.
Assuming this dependency (mentioned in pom.xml) fails (because the jar fails to download):

org.hibernate
hibernate-entitymanager
3.3.2.GA

Then download hibernate-entitymanager-3.3.2.GA manually, and run the command:
mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-entitymanager -Dversion=3.3.2.GA -Dpackaging=jar -Dfile=./hibernate-entitymanager-3.3.2.GA.jar
Thats it, you are all set.
From:
http://qnatech.wordpress.com/2011/07/26/how-to-install-a-jar-manually-in-local-maven-repository/

Meld on mac

In my previous life when Ubuntu was my only work station, both at the office and home, I used to have this cool setup: we committed our work (Java project) to a remote SVN repo. Every time someone did a commit, Hudson sent an email to everyone informing them of this commit, and then it did a build. And then Hudson sent email to everyone informing them whether the last commit built successfully or not.
Our email client was Evolution back then. Evolution had a very nifty diff plugin (emails from Hudson always content diff file), with code indentation and coloring. So when someone committed, or something broke, we could quickly see what was committed or what was going wrong (and who did it!).

Then we all moved to Mac workstations.... to start working on iOS projects. It was a pain to get Evolution and its nifty diff plugin to work on Mac. So we switched to Mac's native Mail app.

And we used an additional app to view the diff, which is meld. But this is still less than ideal, since now I had to switch to meld to view the diff. In Evolution, the diff was embedded in the mail, right below the email message, beautified by the diff plugin.

Recently I need to install meld on my private Mac. This was not so smooth (I don`t remember having problems back then). Anyway, here`s how to install meld on Mac via Macports:

$> sudo port install meld

Run meld. And then you may or may not get the following error:


File "/opt/local/bin/meld", line 75, in 

locale.setlocale(locale.LC_ALL,'')

File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 539, in setlocale

return _setlocale(category, locale)

locale.Error: unsupported locale setting
If you do, do this:

export LANG=C; export LC_ALL=C
And then, if you get the following error:

glib.GError: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Not enough memory)
Do this:
$> sudo port notes dbus
$> sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
$> launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

From:
http://stackoverflow.com/questions/11892957/meld-on-os-x-10-7-doesnt-work
http://computercamp.cdwilson.us/running-meld-on-osx-107-lion

Smartfren errorId 702

Error 702: A connection to the remote computer could not be established…

How to solve:

  • Cabut usb modem anda
  • Buka command prompt (cmd) : Start > Run > Ketik CMD > Enter
  • Masukan perintah “netsh int ip reset c:\resetlog.txt” (tanpa petik) > enter
  • Restart komputer/laptop anda
  • Coba buat konek lagi..

Source:


Bean instances from Spring context must be cast into interface, not implementing class

So I have interface Thinker, and a class Volunteer implementing that interface.

I have a bean like this in my context.xml:


<bean id="thinker" class="springidol.classes.Volunteer"></bean>

And in the Java code:

Thinker vol = (Volunteer)context.getBean("thinker");

I got the following exception:

Exception in thread "main" java.lang.ClassCastException: com.sun.proxy.$Proxy1 cannot be cast to springidol.classes.Volunteer

It turns out that I must cast all beans instantiated from context into its interface, not its implementing class. The following Java code is correct:

Thinker vol = (Thinker)context.getBean("thinker");