Dynamic Float top positions

No Comments

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {

counter = $("#container > div").size(); // count total immidiate children of container
columns = 3;

leftpos = 0;
var myarray = [];
var temp = [];
temp[0] =temp[1] = temp[2] =0;
j=0;

for(i=1;i<=counter;i++)
{

width = $("#div"+i).width();

$("#div"+i).css('left',leftpos+'px');
$("#div"+i).css('top',temp[j]+'px');

$("#div"+i).css('display','block');

leftpos = leftpos + width;
myarray[j] = $("#div"+i).height();

temp[j] = temp[j] + myarray[j]

j++;
if(i%columns==0) {leftpos =0; var myarray = []; j=0;}

}// end of for loop

});

</script>
More

Hosting multiple websites with Apache2 Ubunto Server 10

No Comments

>cd /etc/apache2/sites-available/
> sudo touch mysitename
>sudo chmod 777 mysitename
>vi mysitename

add following text

NameVirtualHost *:8080

<VirtualHost *:8080>
DocumentRoot /path/to/new/site
ServerName userver.local
</VirtualHost>

save and close the vi editor More

Add a user on Ubunto Server

No Comments

Ubuntu Server is like any Linux variety, and has full multi-user capabilities, and a common task on any server is adding users.

useradd

The useradd command will let you add a new user easily from the command line:

useradd <username>

This command adds the user, but without any extra options your user won’t have a password or a home directory.
More