This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
end="$((SECONDS+10))" | |
while true; do | |
[[ "200" = "$(curl --silent --write-out %{http_code} --output /dev/null http://localhost:7474)" ]] && break | |
[[ "${SECONDS}" -ge "${end}" ]] && exit 1 | |
sleep 1 | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function import_extract_first { | |
echo "name:ID(Concept)" > concepts.txt | |
cat data-concept-instance-relations.txt | cut -d $'\t' -f 1 | sort | uniq >> concepts.txt | |
echo "name:ID(Instance)" > instances.txt | |
cat data-concept-instance-relations.txt | cut -d $'\t' -f 2 | sort | uniq >> instances.txt | |
echo $':END_ID(Concept)\t:START_ID(Instance) relations:int' > is_a.hdr | |
$NEO4J_HOME/bin/neo4j-import --into concepts.db --id-type string --delimiter TAB --bad-tolerance 13000000 --skip-duplicate-nodes true --skip-bad-relationships true \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static ExecutorService createDefaultPool() { | |
int threads = Runtime.getRuntime().availableProcessors()*2; | |
int queueSize = threads * 25; | |
return new ThreadPoolExecutor(threads / 2, threads, 30L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(queueSize), | |
new CallerBlocksPolicy()); | |
// new ThreadPoolExecutor.CallerRunsPolicy()); | |
} | |
static class CallerBlocksPolicy implements RejectedExecutionHandler { | |
@Override | |
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) { |
I recently completed an interesting POC of Neo4j 3.1 on Azure, and discovered that there's not much in the way of documentation out there. This Gist provides some notes on how to deploy Neo4j on Azure in enterprise settings, and examines the impact of Bitlocker disk encryption on Neo4j performance for common tasks.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"C:\Program Files\Neo4j Community\jre\bin\java" -cp "C:\Program Files\Neo4j Community\bin\neo4j-desktop-3.0.2.jar" \ | |
org.neo4j.tooling.ImportTool %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// On https://analytics.twitter.com/user/<name>/home | |
// run this in developer console | |
// essentially: | |
$(".home-group-row").map(function(x) { var group=$(this); return group.find(".home-group-header").text()+","+ ['tweets','tweetviews','profile-views','mentions','followers'].map(function(tag) { return group.find(".metric-"+tag).text(); }).join(","); }).toArray().join("\n") | |
// prettied up: | |
var metrics = ['tweets','profile-views','mentions','followers','tweetviews']; | |
"month\t" + metrics.join("\t") + "\n" + |