Tuesday, December 17, 2013

Java Configuration on Windows Machine

For a regular user, all you need is JRE (Java Virtual Machine) to execute Java Application that is already compiled. To install this JRE, when you download the installer from Oracle website. This JRE is used by Windows system and the default browser (i.e. Internet Browser).

For a developer, you would need to java compiler (javac), a.k.a JDK. Recently, Oracle bundles it with application server Glassfish called SDK.

To created environment variable JAVE_HOME
Add JAVA_HOME into variable PATH

Start > cmd >
java -version
javac -version

This java version may be different with java version used by the default browser and java control panel in Windows control panel.

Monday, December 16, 2013

How to get JDK/SDK as a zip file

You're probably like me... just don't want to use installer since it may mess up your system configuration.
However, since late version of Java 6, Oracle no longer offer JDK/SDK as a zip file, but a installer. So how do you get the zip file?
Here is the tricks:

Trick 1:
Download the installer from Oracle (e.g. EE 7 SDK) and install on a lab machine (Windows machine) and then go this location:

C:\Users\YourUsername\AppData\Local\Temp\java_ee_sdk-7-jdk7-windows-x64.exe\Product\Packages

grap jdk7.zip file.

Trick 2:
 Just extract the installer itself (e.g. java_ee_sdk-7-jdk7-windows-x64)

 Go to /Product/Packages and the jdk.zip shoudl be there!


That's it. Easy as that.




Note: Linux box, you may try open jdk.

Thursday, December 12, 2013

Raspberry PI: Get started!

Alright, you just have bought Raspberry PI toy. So what's you gonna do with it? Here's what I did:

1. download this utility (app) if you're using Windows:
 http://sourceforge.net/projects/win32diskimager/

2. download this image and save into your machine:
http://downloads.raspberrypi.org/raspbian_latest

3. plug the SD card into your Windows machine

4. run Win32Imager app: browser to the image file you just downloaded, choose the correct disk name for the SD (mine is E), and hit next (wait for 3-5 min for it to be done)

5. Now plug the SD with Raspbian OS into the Raspberry PI toy and power it on

That's it. It's just quick and easy! Enjoy your new toy!

Note:
1. to use the Raspberry PI behind the proxy for apt-get command, create a file named proxy under/etc/apt/apt.conf.d/ and add this following text line:
Acquire::http::proxy=http://yourproxy.com:port/
2. Keyboard issue: by default the keyboard layout is GB (Great Britain), so when you type <shift>+3, it does NOT show # instead of English pound sign. The same issue with <shift>+2. You can fix the keyboard issue:
sudo nano /ect/default/keyboard
change GB  > US
3. To insall apache2 and php5:
sudo ap-get install update
sudo apt-get install apache2 php5 libapache2-mod-php5
sudo service apache2 restart (apache2 started right after it's installed, you have to restart it here)
apache installation location: /etc/apache2
apache web dir location: /var/ww



Friday, December 6, 2013

Godaddy site: how to test webformmailer

webhosting > launch > hosting > More > form mail>
enter from email address:

then test the mailer

Apache CGI 101

Apache pre-installed on Mac OSX 10.7.5 and CGI is already configured in apache config file.
/private/etc/apache2/httpd.conf

Just place your cgi scripts under: /Library/WebServer/CGI-Excecutables

On your web browser, go to: http://localhost/cgi-bin/test.cgi *

Check apache log file: tail -f  /var/log/apache2/error_log

Start/stop/restart apache instance: sudo apachectl start/stop/restart


* Note: cgi-bin alias must be part of url, otherwise you will get error (files does not exist in the error log). This mistake is very common for beginners to overlook and caused a lot of headache! It took me hours and hours to realize this mistake. At first, I thought some wrong with apache config file and/or with cgi program.

---------------------------
If you want to test ssi exec cgi script in html for your website hosted by godaddy.com, it will not work due to security reason.

Windows: how to turn off login screen

For Windows 7 (Pro version) and 8, use this command
Ctrl + R
control userpasswords2
then uncheck: Users must enter a username and password to use this computer

For Windows 8 on Surface tablet, use a different command:
Search (no Ctrl+R for tablet!)
netplwiz