PlanetPhysics

Friday, October 07, 2011

Tensor related articles on PlanetPhysics. We have a way to go. Basic definition of a tensor.

A larger article in the works for basic tensor theory

One of our favorite uses is the Inertia Tensor and of course this leads to other things like

Labels:

Sunday, June 19, 2011

Ubuntu upgrade:

1) In order to get page images to work and render, I had to do 3 things

a) copy noosphere/bin/map directory from pp-dev (newest build)
b) sudo ln -s /usr/lib/libMagickCore.so.2.0.1 /usr/lib/libMagickCore.so.3
c) sudo apt-get install liblqr-1-0-dev

Wednesday, March 04, 2009

1) Install apache and mod_perl

package name: apache2
apache 2.2.8-1ubuntu0.3

package name: libapache2-mod-perl2

2) Check apache/mod_perl installation

Since, I'm using ubuntu 8.10, I used the example here.

In case the website goes away, let me copy the example here

a) Create Hello.pm in your home directory, and put this txt into it

package Hello;
use strict;

use Apache2::RequestRec ();
use Apache2::RequestIO ();

use Apache2::Const -compile => qw(OK);

sub handler {
my $r = shift;

$r->content_type('text/plain');
print "Hello World, the time here is " . localtime() . "n";

return Apache2::Const::OK;
}

1;
b) Then to make sure that we didn’t make any typos:

perl -c Hello.pm Hello.pm syntax OK


c) Next, open /etc/apache2/apache2.conf and type the following right at the end:

PerlRequire /home/deepakg/Hello.pm

SetHandler perl-script
PerlResponseHandler Hello


d) restart apache

sudo apache2ctl restart
tail /var/log/apache2/error.log


e) Install lynx, so that you can check your handy work/or just use firefox:

sudo apt-get install lynx

# and once it is installed
lynx http://localhost/time

If everything is working then you’ll be greeted with something like this:

Hello World, the time here is Sat Jan 10 15:25:51 2009
3)install mysql packages

mysql-common
mysql-client
mysql-server

4)Check mysql install and create database needed for noosphere

A mysql database will be set up here. You will need root access to
mysql to do the following. Since, I have not configured mysql yet I can
connect as root without a password.

mysql -u root -p

Set the password for root, if there was none

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('******');

Next create a database

mysql> CREATE DATABASE PlanetTest;

Setup a user account for PlanetTest with the following 2 commands

mysql> use PlanetTest;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'bloftin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

Exit mysql and now and we will initialize the database later.

5)install perl packages

libdbi-perl (might already be installed)
libdbd-mysql-perl (might already be installed)
libxml-libxml-perl
libxml-libxslt-perl
libxml-dom-perl
libunicode-string-perl
libdigest-sha1-perl

note Data:Denter is not an available package and we must get it from cpan (later step)

6)install misc packages

vim
ispell
tidy
gs
netpbm
tetex-base
tetex-bin
libmagick
graphicsmagick-libmagick-dev-compat
subversion

6)checkout noosphere from svn

svn checkout http://planetx.cc.vt.edu/svn/noosphere/trunk noosphere

or if you already have a Planet Up (ie. PlanetPhysics), tar compress the current directory

tar -zcvf pp.tar.gz pp

then copy it over to other server to same dir, ie. /var/www


6) Install perl module Data::Denter

Here use CPAN:

sudo cpan

try accepting default questions, then at cpan prompt

install Data::Denter

also install

install Inline::denter

(case sensitive)

Note that this module is deprecated and we should try and upgrade to YAML

7) Migrate database over

From server:
mysqldump -u bloftin -p PlanetPhys > PlanetPhys.sql

To server:
mysql -u bloftin -p PlanetPhys <>

Labels:

Thursday, September 08, 2005

Noosphere Install

Here is a detailed account of installing Noosphere on your local machine. I will be using Ubuntu 5.04.

Step 1: Download Noosphere

There are 2 methods of getting Noosphere. The first is the normal public way through CVS. Simple instructions on this method is given here . The second is if you have access to the subversion repository. If so you can retrieve the newest noosphere and lucene search engine with

svn checkout svn+ssh://pm@planetmath.org/var/lib/svn/noosphere/trunk noosphere
svn checkout svn+ssh://pm@planetmath.org/var/lib/svn/lucene_search_module/trunk lucene_search_module

Of course you will need the password which is not for me to give out. Ask Aaron nicely!

I think there are differences between cvs and svn and I will go through the svn install for now. So once you have the two directories noosphere and lucene_search_module in a temporary folder you need to set it up in a web directory. The default config, which we will use here wants noosphere in the /var/www/pm directory, this can be viewed in the baseconf-example.pm file. We will not change this for now to keep it simple. Next copy the noosphere and lucene directories to this. You most likely will need root privileges so su to root or execute the following:

sudo mv noosphere /var/www/pm
sudo mv lucene_search_module /var/www

The privileges of these folders should stay the same as whoever downloaded them.

Step 2: Install Noosphere Dependencies

The reason this is step 2 is because a lot of details of the installation and dependencies can be found in the downloaded file in the noosphere directory under install/INSTALL. Take a deep breath and relax since this will take awhile. Ubuntu makes most of the installation straight forward. Just open up the Add/Remove Programs under the System Tools menu. From here you can search for packages and install with simple clicks. Below is a list of what I have installed, Note you may get some extra installs based on other required packages:

Mysql

mysql-client 4.0.23-3
mysql-common 4.0.23-3
mysql-server 4.0.23-3
libdbd-mysql-perl 2.9003-3
libmysqlclient12 4.0.23-3

Apache

apache2 2.053-5
apache2-common
apache2-mpm-worker
apache2-utils
openssl
ssl-cert

mod_perl
libapache2-mod-perl2 1.99.14-4
* Important, do not use mod_perl 2 from their website

Perl
perl 5.8.4-6
perl-base 5.8.4-6
perl-modules 5.8.4-6
libdbi-perl 1.46-4
libdbd-mysql-perl 2.9003-3
libxml2 2.6.17-0
libxml-parser-perl 2.34-4 (this is a maybe)
libxml-sax-perl 0.12-5
libxml-namespacessupport-perl 1.08-3
libxslt1.1 1.1.12-3
libunicode-string-perl 2.07-1

* NOTE, the following are not in Ubuntu but are asked for in the INSTALL file
libxml-perl (this maybe in parser and sax)
libxslt-perl
libxml-dom-perl
libdigest-sha1-perl
Data::Denter (Probably need to get this from CPAN)

Vim
vim 6.3-046
vim-common 6.3-046

Misc
ispell 3.1.20.0-4
iamerican
wget 1.9.1-10
tidy 20040811-2
livtidy0 20040811-2
gs 8.01-5
gs-gpl
gs-common
gs-esp
gsfonts
gsfonts-x11
libmagick6
libmagick6-dev (this has lots of dependencies)
netpbm 10.0-8
libnetpbm10

LaTeX
tetex-base 2.0.2c-3
tetex-bin
tetex-doc
tetex-extra
texi2html 1.66-1.2

Now to install the packages that are not included in Ubuntu.

Data::Denter

Go the CPAN search webpage and do a search on Denter. Choose the 'deprecated' Denter package and download the tar file. Untar it and follow the normal perl install method of:

perl Makefile.PL
make
make test
sudo make install

*Note you may fail some prerequisites so go back to CPAN and install the needed packages.

In my case I did not have YAML so download it and execute

perl Makefile.PL
make
make test
sudo make install

Yet another prerequisite is needed, Test::More, so go again to CPAN and download it and install. It seems there no longer is a Test::More and it has been rolled into Test::Simple so just install this one. Once this is done go back into the other directories in install YAML and then Denter. Phew, all should be well with Denter now.

libxml-perl (libxml-libxml-perl)

You need to add more repositories so in the Synaptic Package Manager go to Settings->Repositories and add all possible (universe and multiverse for each drop down box. Once this is done libxml-libxml-perl package will show up so install it. It will need the prereq. libxml-libxml-common-perl.

libxslt-perl (libxml-libxslt-perl)

This package shows up in the manager after the above repositories are added.

libxml-dom-perl

This package shows up in the manager after the above repositories are added. It will need the prereqs. libxml-perl and libxml-regexp-perl.

libdigest-sha1-perl

This package shows up in the manager after the above repositories are added.

Allright, the only thing left is the correct latex2html, but we will wait on this one until it shows up in the INSTALL instructions.

Step 3: Create and setup database

A mysql database will be set up here. You will need root access to mysql to do the following. Since, I have not configured mysql yet I can connect as root without a password.

mysql -u root

Set the password for root, if there was none

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('******');

Next create a database

mysql> CREATE DATABASE PlanetTest

Setup a user account for PlanetTest with the following 2 commands

mysql> use PlanetTest;
mysql> GRANT ALL PRIVILEGES ON *.* TO 'bloftin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

Exit mysql and now it is time to initialize the database. Hold your breath, as we are in uncharted territory with the new schema file. Errors are expected, but do not worry. The svn schema file is broken so use this one . Note that this will only work with mysql version greater than 4.

cd /var/www/pm/db
mysql -u bloftin -p PlanetTest < pm_schema.sql

Next you need to edit the init.sql file to put in your own values. Changes I made include
administrator user:

username - bloftin
email - bloftin@phys-x.org
password - *******

Then input into database with

mysql -u bloftin -p PlanetTest < init.sql

Next comes your classification. For now we will load the default MSC.

mysql -u bloftin -p PlanetTest < msc.sql

Step 4: Install and configure latex2html

Download the latex2html from www,latex2html.org. Right now their website is down so install it for Ubuntu from the package manager

latex2html 2002-2-1-8

Next edit the script in /usr/bin

sudo vi /usr/bin/pstoimg

Around line 261 change the location of gs to

my $GS = '/var/www/pm/bin/gs

For now we will forgo the latex2html patch as it causes some problems until we need it. Now copy the latex2html file to noosphere directory.

cp /usr/bin/latex2html /var/www/pm/bin

Step 5:Build the page image hyperlink mapper

cd /var/www/pm/bin/map
make

*Note: if gcc is not found, install a version (I've install gcc 3.3) and then create a symlink to gcc

sudo ln -s /usr/bin/gcc-3.3 /usr/bin/gcc

Step 6: Permissions

Make the data working directories writable to the user noosphere is running as so

sudo chgrp -R bloftin /var/www/pm/data/cache
sudo chmod -R g+sw /var/www/pm/data/cache

Step 6: Install vim color

sudo cp /var/www/pm/stemplates/pm.vim /usr/share/vim/vim63/colors

More to come, writing this and doing the install at the same time has taken about 4 hours. More to come tomorrow night on the configuration.

Tuesday, August 16, 2005

A promising new turn...

In the main Noosphere module in the subroutine handler, I've replaced the connection condition block to just a simple connection. So ~ line 430 I replaced

unless ($dbh ||= dbConnect()) {
die "Couldn't open database: ",$DBI::errstr;
}
with just

$dbh = dbConnect();

I'm really not sure what ||= is suppose to do, maybe I need to test a similar expression. The following test was made

#!/usr/bin/perl

$test = -1;
unless ($test ||= connect1())
{ die "Die connect1";
}
print "After connect1\n";
print ("$test\n");
$test = -2;
unless ($test ||= connect2())
{ die "Die connect2";
}

print "After connect2\n";
print ("$test\n");

sub connect1()
{
return 1;
}
sub connect2()
{
return 0;
}

The output of running the above perl script is:

After connect1
-1
After connect2
-2

So we observe a few things. The unless statement always evaluates false. If $test is initialized to 1 then the die statement is printed.
- so what seems to happen is that an OR is evaluated on $test and on = Connect1. So if $dbh is true before the statement (so database handle is still true?) then it dies
- what is interesting is that it does not matter what connect returns, it always evaluates to false so this statement completely depends on $dbh

I'm not sure if this is the intended behavior or if it has anything to do with losing the connection with the database. I need some feedback from someone with perl wisdom. However, it seems very promising that the database connection stays 'on'.

Sunday, August 14, 2005

The mysql problem presists.

Saturday, August 13, 2005

I believe the Mysql has gone away error is now fixed. I was able to add multiple entries and edit a few. I changed line 450 in Requests.pm to

my ($rv,$sth)=dbSelect($dbh,{WHAT=>'uid,title',FROM=>$table,WHERE=>
'fulfilled is null'}); #,'ORDER BY'=>'lower(title)'});

By getting rid of the ORDER BY part everything seems ok. I figure people can live without a sorted list for now. I do not understand why this would be a problem since the actual mysql statement executes at a mysql prompt. Oh well. More testing is definately needed.