Friday

Installing & Configuring JSDoc On Windows

SlashdotAdd to Technorati Favorites

This short tutorial will teach you how to install JSDoc on Windows.

JSDOC is a Javascript documentation generator tool. You add formatted comments inside your javascript code, JSDOC takes all the commented javascript code as input and generates javadoc style documentation using those comments. For more details on how to use JSDOC visit http://jsdoc.sourceforge.net/.

DISCLAIMER: I have made every attempt to present accurate information, but I cannot guarantee that inaccuracies will not occur. I (the author) will not be held responsible for any claim, loss, damage or inconvenience caused as a result of any information found on this website (blog).

Lets do the installation and configuration step-by-step
  1. JSDoc is a perl script, so in order to execute JSDoc you have to install a perl interpreter. JSDoc documentation recommends ActivePerl for Windows users.
  2. Download the latest version of ActivePerl from http://www.activestate.com. Install ActivePerl on your windows machine.
  3. Download JSDoc from http://sourceforge.net/projects/jsdoc.
  4. Extract the downloaded zip file (above) in any folder.
  5. Now, in order to run JSDoc using ActivePerl you have to install HTML-Template package for ActivePerl.
  6. Assuming that you installed ActivePerl in c:\perl, go to c:\perl\bin and execute the command ‘ppm’.
  7. ppm is a package manager for ActivePerl. The command ‘ppm’ will open up a window showing you a list of all available packages. Give it sometime to download data from the Internet.
  8. Click on the button that reads “View All Packages” from the leftmost corner of the toolbar (or type Ctrl + 1 together).
  9. You’ll see a complete list of all packages. Scroll down to find HTML-Template. Once you find this package right click on it and click on install. This package will be marked for installation.
  10. Now, you have to install the package that you just marked. Click on the button that reads “Run marked actions” (green colored arrow pointing towards right) or type Ctrl + Enter together.
  11. You’re done. ActivePerl is setup properly to run JSDoc.
  12. Now, assuming that you’re inside the ActivePerl bin (c:\perl\bin) folder and you had extracted jsdoc zip file in f:\jsdoc you’ll run the command below to generate the documentation for a test javascript script file that comes with JSDoc.
perl f:\jsdoc\jsdoc.pl F:\jsdoc\test.js

Thats it.
Documentation will be created inside the bin folder of ActivePerl in a folder named js_docs_out (JSDoc creates the output in js_docs_out folder in the folder where you run the jsdoc script from).

Labels: , , , ,

Monday

Starting Apache Web Server at every Reboot (for Ubuntu / Debian Linux)

Slashdot

If you compiled and installed Apache on a Debian/Ubuntu Linux machine and want the Apache service run every time you reboot your machine this short tutorial is for you. I have tried to make it very simple so I am pretty sure you'll be able to follow all steps even if you don't know Unix/Linux shell scripting.

Before we proceed please read the disclaimer below.

DISCLAIMER: I have made every attempt to present accurate information, but I cannot guarantee that inaccuracies will not occur. I (the author) will not be held responsible for any claim, loss, damage or inconvenience caused as a result of any information found on this website (blog).


In order to run Apache at boot time you have to write a very simple start up script. Follow the steps below. Please note that you ave to run the commands as root for both Ubuntu and Debian.

  • In Ubuntu, do the following (you'll probably be prompted for password).
sudo nano /etc/init.d/apache2
In Debian do the following (as root).
nano /etc/init.d/apache2
The above command will open up a text editor with an empty page (assuming that /etc/init.d/apache2 did not previously exist or was empty).
  • Now, enter the code below in your text editor. Lines starting with a # symbol are comments (except the first line).
#!/bin/sh
case "$1" in
start)
echo "Starting Apache ..."
# Change the location to your specific location
/usr/local/apache2/bin/apachectl start
;;
stop)
echo "Stopping Apache ..."
# Change the location to your specific location
/usr/local/apache2/bin/apachectl stop
;;
graceful)
echo "Restarting Apache gracefully..."
# Change the location to your specific location
/usr/local/apache2/bin/apachectl graceful
;;
restart)
echo "Restarting Apache ..."
# Change the location to your specific location
/usr/local/apache2/bin/apachectl restart
;;
*)
echo "Usage: '$0' {start|stop|restart|graceful}" >&2
exit 64
;;
esac
exit 0

  • Now, press “Ctrl– o” to save the file and “Ctrl – x” to exit from the editor.
  • You have to change the file permissions by executing the command below:
Ubuntu: sudo chmod u+x /etc/init.d/apache2
Debian: chmod u+x /etc/init.d/apache2
  • To start Apache, run command below:
Ubuntu: sudo /etc/init.d/apache2 start
Debian: /etc/init.d/apache2 start

To stop Apache, run command below:
Ubuntu: sudo /etc/init.d/apache2 stop
Debian: /etc/init.d/apache2 stop

To restart Apache, run command below:
Ubuntu: sudo /etc/init.d/apache2 restart
Debian: /etc/init.d/apache2 restart

To restart Apache gracefully, run command below:
Ubuntu: sudo /etc/init.d/apache2 graceful
Debian: /etc/init.d/apache2 graceful

  • In order to add the script to the default runlevel you do the following.
Ubuntu: sudo update-rc.d apache2 defaults
Debian: update-rc.d apache2 defaults

  • In case you want to remove it from the run level you do the following.
Ubuntu: sudo update-rc.d –f apache2 remove
Debian: update-rc.d –f apache2 remove

That’s it you’re done. Now, Apache will start automatically at boot time.

Labels: , , , , , , , ,