< Browse > Home / Archive by category 'HowTo'

| RSS

I had this weird problem, where i had to secure a web server, to which access form the local network is granted by default, but if anyone who is not in the local network tires to access a web page, we had to validate him for username and password.

After some googling, i found this configuration that allowed me to secure the apache directory, this is the configuration


<Directory /var/www/html/123/>

AuthType Digest
AuthName "Intranet"
AuthDigestDomain /
BrowserMatch "MSIE" AuthDigestEnableQueryStringHack=On

AuthDigestProvider file
AuthUserFile /physical/path/to/.digest_pw
Require valid-user
Order Allow,Deny
Allow from 192.168.0.0/255.255.255.0

Satisfy any

</Directory>

There are typically two kinds of authorizations here,
1) Allow from Directive
2) AuthUserFile Directive

The Allow from directive allows traffic from the specified ip range, and the AuthUserFile validates allows the validation of user credentials, if he/she has given them. The Satisfy any directive allows apache to validate any one of teh above conditions to grant access to the specified resources.

[ View Post ]

There can be many instances where you would like to preload images in a HTML primarily for caching in order to serve the page better. This can be achieved by the use of Image objects in JavaScript. Image Object allow dynamic creation and manipulation of images in JavaScript, it is support by IE 4+ and Firefox.

Preloading Image

Preloading an image can be done by invoking a small JavaScript, that creates an image object and loads an image from the URL specified in the src parameter. See below


<head>
<script type="text/javascript">
<!--
image01= new Image();
image01.src="http://www.google.co.in/intl/en_com/images/logo_plain.png";
image02= new Image();
image02.src="http://labs.google.com/images/labs_logo2.gif";
//-->
</script>
</head>

The most optimal place to trigger the preloaded is on the body onLoad(), so that the images will start loading once the page has completed loading.

Changing images in JavaScript

The most immediate function after loading/caching and image is to use it somewhere in the html page, this can be achieved easing using JavaScript
See Full Example below


<html>
<head>
<title>Page title</title>
<script language="JavaScript">
objImage1 = new Image();
objImage2 = new Image();
objImage3 = new Image();
cnt = 0;
function preLoadImages(){
// preload the image file
objImage1.src='http://www.google.com/logos/mlk09.gif';
objImage2.src='http://www.google.com/logos/newyear09.gif';
objImage3.src='http://www.google.com/logos/olympics08_opening.gif';
}

function changeImage() {
cnt++;
if (cnt==1) {
document.images['im'].src = objImage1.src;
}
else if (cnt==2) {
document.images['im'].src = objImage2.src;
}
else if (cnt==3) {
document.images['im'].src = objImage3.src;
cnt=0;
}
}
</script>
</head>
<body onLoad="preLoadImages()">
<form name="myWebForm">
<img name="im" src="http://www.google.com/logos/olympics06_opening.gif"><br>
<input type="button" name="Prev" value="Switch Image " onClick="changeImage()">
</form>
</body>
</html>
[ View Post ]

There are a whole bunch of systems that are involved in setting up development environments, some of them range from issue trackers to version control systems and even text editors. Everyone has some preference, choice and a point-of view about things, and so do I. Here is my list of essential systems and software from a good open source web development environment. I have classified my list into multiple categories 

Collaboration Tools

  • Issue Tracking : Bugzilla
  • Bugzilla is by far the coolest bug tracking system I have ever seen in the opensource market. I like bugzilla because of its simplistic approach to bug tracking. It gives what you need in a simple user interface and its easy to configure and integrate. 

  • Project Management: MediaWiki
  • You should call me nuts for calling MediaWiki a project management software. Yet if you ask me about project management, i would say mediawiki does the job. Project Management primarily for micro-development teams is about collaboration, information sharing in a semi organized way. Of all the tools that i evaluated for project management, if found media wiki to be only one perfectly doing the job.

  • Version Control: Subversion
  • Subversion is a class apart; it was chosen as the version control system without even evaluation. Its really quick, easily manageable, has certainly good reliability and access controls. 

  • Version Control Web GUI: Sventon
  • There are a lot of good (better) subversion WebGUIs available for subversion, but I choose this one because this was free, and it gave me what I needed.

Development Environment

  • Windows Environments
  • Web Server : Apache (or) IIS
  • IDE: Eclipse (or) Zend Studio, Dreamweaver**
  • TortoiseSVN - the ultimate choice
  • Windows Stack: XAMPP
  • Linux Environments
  • Web Server : Apache
  • IDE: Eclipse/PDT (or) Zend Studio
  • KDE SVN Client or Some SVN Client
  • Database: MySQL
  • Eclipse Plugins
  • PDT for Eclipse
  • Subclipse for Eclipse
  • Takstop for Eclipse integrated with Bugzilla works a as a great issue tracking client.

Zend Studio is a must have if you are a php developer, zend studio comes with a whole lot of features and tools that help in increasing the efficiency of php development.

** Dreamweaver is not an open source software; there are practically no opensource tools to match Dreamweaver in Web designing IDE’s. 

[ View Post ]

The user friendliness of TortoiseSVN is probably the best feature that Windows ever had, that linux didn’t. Having searched through a wide number of sites and blogs trying to find a good alternative for Tortoise SVN, I was able to shortlist the following tools

My Personal best choices are,

  1. Subclipse for Eclipse
  2. KDESVN + Nautilus Scripts for Standalone clients

KDESVN + Nautilus Script as Standalone SVN clients

KDESVN is a Visual SVN Client tool that can be installed in Ubuntu. Try this command to install it

>> sudo apt-get install subversion kdesvn kompare

KDESVN gives users the ability to connect to a subversion repository and perform operations. But the coolest thing about Tortoise SVN is that its accessibility, it is available everywhere on the right click menu. So in order to replicate the ease of use, we will need to replicate the right click functionality in local file browser (which is nautilus). This can be done using a few nautilus scripts

KDESVN connected to nautilus script

KDESVN connected to nautilus script

After Installation, you will have to configure the rightclick menu scripts here

>> ~/.gnome2/nautilus-scripts

create a file called “kdesvn.sh” with the following contents

>> #!/bin/sh
>> kdesvn $1

assign execute rights to that file

>> chmod +x kdesvn.sh

Now open the file browser, you will be able to see KDESVN in the scripts context menu. To activate the SVN client, select some folder in local repository, and try the menu. It will popup the KDESVN interface.

[ View Post ]

Install/ Upgrade OpenOffice 3.0 in Ubuntu 8.04

Ubuntu 8.04 comes with openoffice 2.x version, even after updating with apt-get you will only get the latest build of the 2.x version open office. In order to upgrade to the latest version of open office (which is the 3.0 version), you will have to uninstall the existing version of open office. download the latest verion and install it.

The installation process is as follows

1) Download the latest verion of Open office from the following site, http://download.openoffice.org/other.html. You will need to choose “Linux DEB” for ubuntu.

2) Once you have downloaded the installer (say OOo_3.0.0_LinuxIntel_install_en-US_deb.tar.gz), you can extract the file to a temp folder say /home/krishna/Desktop/Office3Install/

3) Now having kept the setup files ready, uninstall teh existing verion of OpenOffice. This can be done using the command.

sudo apt-get remove openoffice*.*

4) Now to Install the OpenOffice 3.0 Version navigate the folder where the files are extracted and run the following command

sudo dpkg -i /home/krishna/Desktop/Office3Install/DEBS/*.deb

5) Once the Installation is complete, you can add the OpenOffice 3.0 to the gnome menu.

sudo dpkg -i /home/krishna/Desktop/Office3Install/DEBS/desktop-integration/*.deb

Thats it, OpenOffice is upgraded now :)

[ View Post ]

  • Page 2 of 2
  • <
  • 1
  • 2