Skip to content

Instantly share code, notes, and snippets.

View coolgarifTech's full-sized avatar

coolgarifTech

View GitHub Profile
@coolgarifTech
coolgarifTech / neo4j_install_steps.sh
Last active December 17, 2015 09:08
Setting up NEO4J for the first time on ubuntu using the command line
mv neo4j-community-1.8.2-unix.tar.gz /home/userName/neo4j/neo4j-community-1.8.2-unix.tar.gz
cd /home/userName/neo4j
tar -xzf neo4j-community-1.8.2-unix.tar.gz
ls
# > neo4j-community-1.8.2
mv neo4j-community-1.8.2 hydraGraph
@coolgarifTech
coolgarifTech / hydraGraph_build.py
Last active December 17, 2015 09:59
Simple script for creating the hydraGraph DB for Coolgarif Tech using Python Embedded bindings
# Script written by Richie Barter of Coolgarif Tech
# Date: April 2013
from neo4j import GraphDatabase
db = GraphDatabase('/home/userNAME/neo4j/hydraGraph/data/graph.db')
with db.transaction:
# Create an index for nodes & relations
@coolgarifTech
coolgarifTech / gist:5599840
Created May 17, 2013 15:32
Exporting Java Home
$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
@coolgarifTech
coolgarifTech / gist:5599858
Created May 17, 2013 15:34
Permanently setting the Java_Home and Classpath in your Ubuntu environment!
$ sudo nano /etc/environment
JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
CLASSPATH="/usr/lib/jvm/java-7-openjdk-amd64/lib:."
@coolgarifTech
coolgarifTech / gist:5599870
Created May 17, 2013 15:36
How to find the NEO4J config files to complete setup
$ cd /home/userName/neo4j/hydraGraph/conf
$ ls
custom-logback.xml neo4j-wrapper.conf logging.properties neo4j-http-logging.xml
README.txt neo4j.properties ssl neo4j-server.properties windows-wrapper-logging.properties
@coolgarifTech
coolgarifTech / gist:5599879
Created May 17, 2013 15:37
Line to edit for port access in neo4j-server.properties config file
# http port (for all data, administrative, and UI access)
org.neo4j.server.webserver.https.port=7475
@coolgarifTech
coolgarifTech / gist:5599887
Created May 17, 2013 15:39
Altering the service name in the neo4j-wrapper.conf for server confirg
# Name of the service
wrapper.name=neo4j-hydraGraph
@coolgarifTech
coolgarifTech / gist:5600214
Created May 17, 2013 16:20
Instantiating a database object with python embedded in Neo4j
# Script written by Richie Barter of Coolgarif Tech
# Date: April 2013
from neo4j import GraphDatabase
db = GraphDatabase('/home/userNAME/neo4j/hydraGraph/data/graph.db')
@coolgarifTech
coolgarifTech / gist:5600426
Created May 17, 2013 16:54
Creating an index using python embedded bindings in Neo4j
with db.transaction:
# Create an index for nodes & relations
COMPANY_NAME_INDEX = "COMPANY_NAME_INDEX"
if db.node.indexes.exists(COMPANY_NAME_INDEX) == 0:
companyNameIndex = db.node.indexes.create(COMPANY_NAME_INDEX)
else:
companyNameIndex = db.node.indexes.get(COMPANY_NAME_INDEX)
@coolgarifTech
coolgarifTech / gist:5600444
Created May 17, 2013 16:57
Creating a single node using python embedded bindings in Neo4j
coolgarifTech = db.node(name = 'CoolgarifTech', description = 'Digital Agency focused on Data', established="Jan 2013", founders="Richie Barter & James Billot")
companyNameIndex['name']['CoolgarifTech'] = coolgarifTech
companyNameIndex['description']['Digital Agency focused on Data'] = coolgarifTech