Install Mac OS on windows laptop

You need: iAtkos ML2 (Mountain Lion 10.8.2 or higher)An 64 Bit laptopUSB Flash (capacity 8gb or larger)Plenty of time (esp the laptop does not have an SSD ) You need tp download iAtkos ML2 as a DMG file and write to your USB Flash. You can find the file from various torrent sites. You need a Mac computer or a virtual host Mac to write the DMG to your USB. If you have your USB Flash ready with iAtkos ML2 DMG, then plug it in to your computer and reboot. You may need to choose boot from USB (press F12 on some BIOSes) Some important steps: BIOS setting must bring to factory defaults and activate "Intel Virtualization Technology" setting on your BIOS. You may need to activate verbose mode of iAtkos ML2 by pressing  -v key combination.  If your HD has a partition , erase it and create a brand new Mac OS partition. If you have an old graphics card (not Mobility) you have to disable graphic card activation. Once you configure your MacOS , you can upgrade to latest from Apple Menu.

A Simple webserver on your Mac to access your files remotely from Windows

Open a terminal window and run following commands :

$ cd /Documents/yourSharedFiles
$ python -m SimpleHTTPServer 8080
Serving HTTP on port 8000 ...

That's it!!! Your web server is started. 

On the browser, type following address to access your files remotely.


The contents of your current directory must be shown on the browser now.

Advanced issues & troubleshooting:

8080 is the port number. If you get "socket.error: [Errno 48] Address already in use" , change the port number to another one. (less than 65536)

If you want to make your webserver run in port 80 , launch the command above with sudo and enter your root password :

$ python -m SimpleHTTPServer 80

Serving HTTP on port 80 ...

in this case the url will be :


Make sure to shut the webserver down when you are done with cmd-c key or just closing the terminal window.

Connect via SSH without a password from MacOS to Linux with an SSHKEY

Don't panic , it is really easy.

Your Steps will be:
1. Create a key on your Mac
2. Define your key on remote Linux
3. Connect via ssh.

1.  Create the key on your Mac

Open the terminal :)

First make a directory named .ssh on your home directory (mkdir .ssh) If it exist , no problem. Go to the newly created .ssh directory with command cd .ssh

Then, you need to create a ssh key on your MAC.

There will be 2 files for key. If you dont want any passwords , just press enter when passphrase asked.

Filename will be default id_rsa if you just hit enter. But if it already exists , you may want to choose another name.
Hakos-MacBook-Pro:.ssh hakan$ ssh-keygen -t rsa -C "" Generating public/private rsa key pair. Enter file in which to save the key (/Users/hako/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/hako/.ssh/id_rsa. Your public key has been saved in /Users/hako/.ssh/id_rsa.p…

ClassNotFoundException in java

java.lang.ClassNotFoundException occurs when your JVM can not find a required class within your application. The most common cause of this exception is missing required jar's in your project.

If you got this exception in Eclipse you should check your project settings. (Right click on your project , choose BuildPath and Configure BuildPath. Find Libraries tab and add required jars or libraries which are bunch of jars)

If you got this exception in command line first be sure to run your your class in correct directory. For example you have a test.Tester class. Since each package is in a folder, you run your class in upper directory of the test in command prompt.

If your class file is :

then you should run :
$cd /usr/home/youruser
$java test.Tester

If you use some jars or some other class files from other places , check your classpath. You can fix this in 2 ways.

1. You can add your jars folder to CLASSPATH environment variable of your Op…

Where to put Config or Properties files on Eclipse?

On top directory of your project. In Eclipse environment workdirectory of any launched class (Run As Application) is the projects main folder , that is , the directory named by your proj. For example : c:\eclipse\workspace\MyProject.

String Performance

Perhaps string concatenation is the most frequently used string operation in any language. In Java you can concat two string in this manner:

String concatdStr = "String1"+"String2"+" and String3";

But this is not a good idea. Behind the curtain , Java does string concatenation using StringBuffer class. So the above concat becomes :

String sBuf = new StringBuffer(32);
sBuf.append("String1").append("String2").append(" and String3");

Clearing WAR , EAR JAR files for .svn folders and library jars

Big archieve sizes can be annoying. There can be some useless files within a war or jar file.

1. If you uploaded your library files to application server than you do not need to pack them everytime you create application archieve file.

2. There can be subversion folders which do not have a function in runtime.

I wrote a basic windows batch file. it uses 7-zip.


cd %TEMP%
rem "C:\Program Files\7-Zip\7z.exe" d %1 *.jar -r -tzip
"C:\Program Files\7-Zip\7z.exe" d %1 .svn -r -tzip
rem "C:\Program Files\7-Zip\7z.exe" d %1 WEB-INF\lib -tzip

paste this code to file.

first line is the for the temp files.

if you want to clear all jar files within your archieve , and you know what you are doing , delete rem part of line 2 , otherwise you can delete delete line 2.

3rd line deletes all .svn folders within your archieve file. if you donot want to do this , delete line 3.

if you want to delete web-inf/lib , delete rem part of 4th line. (