May 022012
 

One of the tasks that almost every web master need to check form time to time is to list loaded modules in Apache web server, fortunetly standard Apache installation in Linux distributions comes with useful tool called apachectl.

in Debian and Ubuntu you can use the following

apache2ctl -t -D DUMP_MODULES

it will print all loaded modules :

Loaded Modules:
 core_module (static)
 log_config_module (static)
 logio_module (static)
 mpm_prefork_module (static)
 http_module (static)
 so_module (static)
 alias_module (shared)
 auth_basic_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 deflate_module (shared)
 dir_module (shared)
 env_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 php5_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 ssl_module (shared)
 status_module (shared)
 vhost_alias_module (shared)
Syntax OK

 

Please note some Linux distribution uses apachectl instead of apache2ctl

Feb 242011
 

Lately I had a task to publish some word documents with tables on a web site, after saving the file as filtered web site Microsoft Word produced a 250 KB file !! looking closely at the source code I notice their was 5 line of styles and unnecessary tags for every cell in the HTML table! fast search in Google resulted with Tidy, I installed the command line version as it was already included in Ubuntu 10.10 Maverick Meerkat repository, I run it and wow 30 KB result with clean and formated HTML.

here are the option I used in Tidy to cleanup the code:

bare: yes, clean: yes, drop-empty-paras: yes, drop-font-tags: yes, join-styles: yes, output-xhtml: yes, word-2000: yes

for more option check http://tidy.sourceforge.net/docs/quickref.html and for the online tool check Clean up HTML

Feb 132011
 

First you need to check that Ubuntu Partners repository is enabled in your apt sources list, open /etc/apt/sources.list and uncomment the following line:

deb http://archive.canonical.com/ubuntu maverick partner

Then in command line type

sudo apt-get update
sudo apt-get install sun-java6-jdk

As well you need to set Sun Java as default Java provider in your system by typing the following in command line

sudo update-alternatives --config java

You will be presented with the screen similar to this one:

There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                      Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      auto mode
  1            /usr/lib/jvm/java-6-openjdk/jre/bin/java   1061      manual mode
  2            /usr/lib/jvm/java-6-sun/jre/bin/java       63        manual mode

Press enter to keep the current choice[*], or type selection number: 2

Select the option that has the path /usr/lib/jvm/java-6-sun/jre/bin/java and you are done.
to check if you are using the Sun Java provider type the following:

java -version

You should see a screen similar to the below

java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
Get Adobe Flash player