Ярлыки

четверг, 25 октября 2012 г.

Installing OracleClient11g on UbuntuServer

It's did by this instruction: http://www.gena01.com/forum/gena01-blog/oracle-instant-client-11g-on-ubuntu/

I did follow:

1. Installling libaio1 (must for Oracle 11g, optional for 10):
apt-get install libaio1

2. Installing alien:
apt-get install alien


3. Downloading RPMs from here:
http://www.oracle.com/technetwork/topics/linuxsoft-082809.html

4. RPMs converting into .deb through alien:
alien [download_file.rpm]

5. Installing debian-package:
dpkg -i [file_from_paragraph_4.deb]
 
6. And finally, doing this command:

aptitude search oracle
And we must see: 


p   cl-sql-oracle                                                          - CLSQL database backend, Oracle
p   libmono-oracle1.0-cil                                                  - Mono Oracle library
p   libmono-oracle2.0-cil                                                  - Mono Oracle library
i   oracle-instantclient11.1-basic                                         - Instant Client for Oracle Database 11g
i   oracle-instantclient11.1-devel                                         - Development headers for Instant Client.
i   oracle-instantclient11.1-sqlplus                                       - SQL*Plus for Instant Client.
p   spamoracle                                                             - A statistical analysis spam filter based on Bayes' formula
p   spamoracle-byte                                                        - A statistical analysis spam filter based on Bayes' formula

Install Django on UbuntuServer

How I installed Django on UbuntuServer 11.04 - the Natty Narwhal
python2
django1.3

Apache already installed. 

Installing apxs2: 
 sudo apt-get install apache2-threaded-dev

Installing mod_python-3.3.1:
sudo apt-get install libapache2-mod-python

stop Apache:
sudo /etc/init.d/apache2 stop

Than we write settings in Apache config file (for me - /etc/apache2/apache2.conf). This settings bind Django with URL:
#Connect to mod_python:
LoadModule python_module /usr/lib/apache2/modules/mod_python.so

#Connect Django with URL:
<Location "/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE settings
    PythonDebug Off
    PythonPath "['/home/vinger4/vinger4site','/usr/local/lib/python3.2/dist-packages/django'] + sys.path"
    PythonAutoReload Off
</Location>

Correcting urls.py and settings.py
You must delete prefix of you site (in my case - vinger4site), because it wrote in PythonPath for Apache (please, see previous paragraph).

start Apache
sudo /etc/init.d/apache2 start

Now each request to the server must go through Apache.

Virtual Machine Image with Django


Virtual Machine Image with Django: 
http://bitnami.org/stack/djangostack

вторник, 2 октября 2012 г.

neo4j: class RelTypeFilterExcluder example


public class RelTypeFilterExcluder implements Predicate<Object> {
Set<String> exclude;

public RelTypeFilterExcluder(Set<String> excludeInput) {
this.exclude = excludeInput;
}

@Override
public boolean accept(Object arg0) {
String typeItem = ((PropertyContainer) arg0).getProperty("type").toString();
if ( this.exclude.contains(typeItem) ) {
return false;
}
return true;
}

}