You're reading from Learning Neo4j 3.x - Second Edition
Even on a development machine that I use everyday, I may have forgotten the clever password I set up for the user Neo4j, as I have several versions installed on my machine.
The solution is to stop your server, then change the directory to the data/dbms subfolder, and remove the file named auth.
To know what hosts are running on your local network, with SSH access enabled, I offer you this little script:
#!/bin/bash
port=22
for ordi in `nmap -sn 192.168.0.1-100 /25 | egrep "scan report" | awk '{print $5}'`
do
echo Found IP $ordi on network.
echo --------------------------------------
done
echo Now trying them for port $port , sorry for the timeout on successful connections
echo
for ordi in `nmap -sn 192.168.0.1-100 /25 | egrep "scan report" | awk '{print $5}'`
do
echo Trying $ordi on port $port
cat < /dev/tcp/$ordi/$port
echo --------------------------------------
done
You may need to adapt this to change the IP range. Unix super users...
When I installed the latest distribution on an SD card as the operating system for a brand new Raspberry Pi, unfortunately, I had no television to plug it to. Too bad, for it makes it impossible to run the usual setup. Worse, the Pi was running, doing nothing, and was inaccessible.
Fortunately, remote access is possible by enabling SSH, which is already installed.
When you have burnt the ISO to the SD card, two drives appear. One is the future root filesystem of your Pi, and the second named boot is where you must create an empty file named ssh
(no extension).
There you go; plug a network cable and it is online. You can now log into it via SSH and run raspi-config
.
When you are in a situation where you need to display data to users but cannot create an application for that, an option to consider is to create guides, locally hosted so that your users just need to click on the queries to get the results. There is no risk if they have the reader role.
The first obvious option is to look at a guide and see how the source is structured. The second option is to look at the project neo4j guides available at https://github.com/neo4j-contrib/neo4j-guides.
This project proposes to convert a document in the asciidoc format to an HTML guide.
Here is a starter guide:
== Learning Neo4j :author: Jerome BATON :twitter: wadael === Guides Guides are very useful to quickly propose read-only queries to users. See the arrows, I wrote no distinct source for that. Click it please === Add pictures You can add pictures with this code [source, text] ---- image::https://neo4j.com/wp-content/themes/neo4jweb/assets/images/neo4j-logo-2015...
Depending on the version you are using, the way to backup and restore your data will be different.
To back up your data of a community version server, only cold backup (offline) is possible.
A first way, very basic, but not to say DIY, is: first stop your server, then copy the whole $NEO_HOME/data
folder to a secure storage. Then restart your server.
To restore backup data, stop your server, replace the $NEO_HOME/data
folder with your backup, and restart your server.
Another way is to use the neo4j-admin
utility program, installed with the server in $NEO_HOME/bin
:
neo4j-admin dump --to=file --database=optionnalDBName
The to parameter should be a path to a file. The database parameter is optional and only needed if you have more than one database and want to dump a database other than graph.db
.
To restore this dump of data, the command is as follows:
neo4j-admin load from=file
Let's have a look at a few of the tools.
Cypher-shell is a command-line tool that comes with the default installation of Neo4j.
You will find it in the $NEO_HOME/bin
folder. As already stated, it allows you to run Cypher queries interactively on a Neo4j server, such as the Neo4j browser:
Cypher-shell, interactive mode
It is also possible to use it in a unix-ian way, as the destination of a file. Suppose that we have a file named count.cy
containing this query:
MATCH (n) RETURN count(n);
We can use Cypher-shell like this:
Cypher-shell, in 'like a sysadmin' mode
Talend (www.talend.com) is an open source software vendor that provides data integration, data management, enterprise application integration, and Big Data software and services. They have a very extensible, visual, and powerful development environment for all kinds of integration services that can be connected together in a workflow designer style environment.
MuleSoft (www.mulesoft.com), headquartered...
These are projects definitely worth having a look at:
- https://github.com/cleishm/libcypher-parser: libcypher-parser is a parser library and validation (lint) tool for Cypher, the graph query language.
- Structr (https://structr.org): Struct is an application generator, do their sample application tutorial, watch the video, and you will be amazed !
- https://neo4j-client.net/: Another command-line client.
- https://github.com/anvaka/ngraph.path: A JS library for fast path finding in arbitrary graphs.
- There is another visualization library worth your time, which is
Popoto.js
(http://www.popotojs.com/). It is built precedingD3.js
. - https://github.com/neo4j-contrib/neo4j-graph-algorithms: More efficient graph algorithms for Neo4j.
Neo4j Inc. provides a very good amount of documentation on its product; see https://neo4j.com/docs/.
The YouTube channel, https://www.youtube.com/c/neo4j, provides the videos of the graph connect events (and more).
Find the APOC userguide at https://neo4j-contrib.github.io/neo4j-apoc-procedures/.
As open source users, we sometimes seek for help and sometimes offer our help. There is a Neo4j tag on StackOverflow, https://stackoverflow.com/questions/tagged/neo4j, for all the Neo4j questions.
There are several Slack channels; see https://neo4j.com/developer/slack/.
If you use Twitter, follow them all: @neo4j
, @mesirii
, @emileifrem
, @rvanbruggen
, @craigtaverner
, @Aethelraed
, @darthvader42
, @tb_tomaz
, @lyonwj
, @maxdemarzi
, @markhneedham
, @BarrasaDV
, @ryguyrg
, @andres_taylor
, @iansrobinson
, @apcj
, @jimwebber
, (and maybe @wadael
, too).
Graph Connect conferences and local meetups are a very good way to meet fellow graphistas, exchange tips, and push job offers.
To close this book on a lighter note but with wisdom anyway, here are some proverbs.
(As Lili said:) Trash in ! trash out ! Meaning if you do not put in the maximum care when you import data, you will get the data you deserve as query results!
Take care of the nulls, do not import numbers as strings, and use booleans when needed.
Everything is misplaced when you mistake latitude and longitude!
Having one's child's name on a book cover makes family happy!
The joy of learning calls for the joy to teach!
Authors love feedback!