Skip to content

Instantly share code, notes, and snippets.

Paulo Fabrício paulozullu

  • Salvador, Bahia, Brazil
Block or report user

Report or block paulozullu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paulozullu
paulozullu / linux_swap_file.md
Last active Jul 17, 2019
How to create swap file.
View linux_swap_file.md

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 / neo4j_delete_duplicate_nodes.md
Created Apr 12, 2019 — forked from jruts/neo4j_delete_duplicate_nodes.md
How to delete duplicate nodes and their relationships in neo4j with cypher?
View neo4j_delete_duplicate_nodes.md

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 / certbot.md
Last active Mar 8, 2019
Let's Encrypt certbot (HTTPS)
View certbot.md

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 / javascript_tips.md
Last active Apr 25, 2019
jquery and javascript tips
View javascript_tips.md

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);
View tips.MD

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 / foundation.MD
Last active Oct 24, 2018
Foundation tips
View foundation.MD

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 / clean-up-boot-partition-ubuntu.md
Created Aug 28, 2018 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64
View clean-up-boot-partition-ubuntu.md

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 Aug 13, 2018 — forked from BlakeGardner/compact.js
Compact all collections inside of a MongoDB database
View compact.js
// 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 });
});
View linux_tips.MD

Fixes and tips for Linux

1 - Headset mic not recognized

$ sudo nano /etc/modprobe.d/alsa-base.conf

Add bottom:

options snd-hda-intel model=laptop-dmic

Save and reboot

@paulozullu
paulozullu / libreoffice_calc.MD
Last active Apr 3, 2018
Libre Office Calc Tips
View libreoffice_calc.MD

Convert UNIX timestamp to date in LibreOffice Calc

As it seems, OpenOffice's "day 0" is December 12th, 1899; that implies that January 1st, 1970 is day 25569 for OpenOffice. Now, if you divide a UNIX timestamp by 86400 (the number of seconds in a normal day), that will give you the number of days between the epoch and that timestamp (and some decimal, that you can use to calculate the time of day). And if you sum that number with 25569, you have an OpenOffice day for that timestamp.

Alright, let's put all the pieces together: let's say cell A2 contains a UNIX timestamp 1341104400, then this formula

=A2/86400+25569

will return a number. And if you format that cell as a date, DD/MM/YYYY HH:MM:SS, then you'll read a pretty "01/07/2012 01:00:00" there.

You can’t perform that action at this time.