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
View GitHub Profile
@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 });
});
@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 / foundation.MD
Last active October 24, 2018 18:35
Foundation tips

1 - Error on opening an reveal modal throwing (We're sorry, 'open' is not an available method for this element.)

var popup = new Foundation.Reveal($('#myElement'));
popup.open();
@paulozullu
paulozullu / tips.MD
Last active November 14, 2019 12:27
MI A2 tips

Update Havoc OS

- boot twrp
- flash update 
- wipe cache and dalvik 
- flash twrp installer
- wipe cache and dalvik 
- change slot
- reboot recovery
- install GAPPS
@paulozullu
paulozullu / javascript_tips.md
Last active April 25, 2019 13:57
jquery and javascript tips

1 - Convert string to Date (dd/mm/aaaa)

var from = $("#datepicker").val().split("-");
var f = new Date(from[2], from[1] - 1, from[0]);

2 - Convert now date to Date

var time = Date.now();
var date = new Date(time);
@paulozullu
paulozullu / certbot.md
Last active March 8, 2019 13:31
Let's Encrypt certbot (HTTPS)

Step 1 — Installing Certbot

The first step to using Let's Encrypt to obtain an SSL certificate is to install the Certbot software on your server.

Certbot is in very active development, so the Certbot packages provided by Ubuntu tend to be outdated. However, the Certbot developers maintain a Ubuntu software repository with up-to-date versions, so we'll use that repository instead.

First, add the repository.

$ sudo add-apt-repository ppa:certbot/certbot
@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 / linux_swap_file.md
Last active July 17, 2019 12:21
How to create swap file.

Step 1 -- Checking the System for Swap Information

Before we begin, we can check if the system already has some swap space available. It is possible to have multiple swap files or swap partitions, but generally one should be enough.

We can see if the system has any configured swap by typing:

sudo swapon --show
@paulozullu
paulozullu / geos_error.md
Created March 20, 2020 16:00
Teknoloxica

Edit this file: site-packages/django/contrib/gis/geos/libgeos.py Look for the function: geos_version_info And change this line:

ver = geos_version().decode()

With this line:

ver = geos_version().decode().split(' ')[0]
@paulozullu
paulozullu / translate.html
Created September 10, 2020 11:55
Google translate
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>
How To Add Google Translate
Button On Your Webpage ?
</title>
</head>