Skip to content

Instantly share code, notes, and snippets.

View paulozullu's full-sized avatar
🏠
Working from home

Paulo Fabrício paulozullu

🏠
Working from home
  • Salvador, Bahia, Brazil
View GitHub Profile
@paulozullu
paulozullu / neo4j_delete_duplicate_nodes.md
Created April 12, 2019 12:37 — forked from jruts/neo4j_delete_duplicate_nodes.md
How to delete duplicate nodes and their relationships in neo4j with cypher?

How to delete duplicate nodes and their relationships in neo4j with cypher based on a property of that node?

The problem is easy to understand. We have 'duplicate' nodes in our database based on the 'id' field on the node properties.

Well this sounds easy enough, until you have to actually do it.

First step

My first attempt was to try and figure out which nodes are actualy duplicate (based on a property on the node). This seems to be pretty straightforward.

Cypher:

@paulozullu
paulozullu / clean-up-boot-partition-ubuntu.md
Created August 28, 2018 02:23 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@paulozullu
paulozullu / compact.js
Created August 13, 2018 16:41 — forked from BlakeGardner/compact.js
Compact all collections inside of a MongoDB database
// This script loops though the list of collection names in a MongoDB and runs the compact operation on them
// Simply paste this into the Mongo shell
use testDbName;
db.getCollectionNames().forEach(function (collectionName) {
print('Compacting: ' + collectionName);
db.runCommand({ compact: collectionName });
});