Skip to content

Instantly share code, notes, and snippets.

View romuloctba's full-sized avatar
:octocat:

RcDev romuloctba

:octocat:
View GitHub Profile
@romuloctba
romuloctba / nodejs.signfile.js
Created June 3, 2020 07:06 — forked from zfael/nodejs.signfile.js
Node.JS - CRYPTO How to sign a file
//how to execute: node sign.js <path file> <path private key>
//output: signature of file
var crypto = require('crypto');
var fs = require('fs');
var args = process.argv.slice(2);
var fileName = args[0];
var keyPath = args[1];
//openssl genrsa -out key.pem 1024
@romuloctba
romuloctba / nodejs.verifysignedfile.js
Created June 3, 2020 07:05 — forked from zfael/nodejs.verifysignedfile.js
Node.Js - CRYPTO How to verify a signed file
//how to execute: node verify.js <path file that you want to verify> <certificate path> <hash generate by sign.js>
//output: true if files are equal, false otherwise.
var crypto = require('crypto');
var fs = require('fs');
var args = process.argv.slice(2);
var fileName = args[0];
var certPath = args[1];
var sig = args[2];
@romuloctba
romuloctba / inotify_arch_linux.md
Created April 27, 2020 00:33 — forked from joseluisq/inotify_arch_linux.md
Increasing the amount of inotify watchers in Arch Linux

Increasing the amount of inotify watchers in Arch Linux

If you are running ArchLinux, run the following command instead (see here for why):

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system

Then paste it in your terminal and press on enter to run it.

@romuloctba
romuloctba / PrivateEthereumCluster.md
Created November 25, 2018 20:30
Setup private Ethereum network with Docker

Setup private Ethereum network with Docker

Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference.

This is a step-by-step guide, how to setup private Ethereum network. 

We’ll set up a network and create two simple JSON-RPC clients in order to communicate with our Ethereum nodes.

@romuloctba
romuloctba / introrx.md
Created June 15, 2018 14:40 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@romuloctba
romuloctba / wordpress-custom-import-tutorial-demo.php
Last active January 20, 2023 22:32 — forked from royduin/import-demo.php
Example Wordpress custom import (post type, meta, image from url, etc) see: https://royduineveld.nl/creating-your-own-wordpress-import/
<?php
/*
Plugin Name: Import demo
Plugin URI: http://royduineveld.nl
Description: A demo import for my blog
Version: 1.0
Author: Roy Duineveld
Author URI: http://royduineveld.nl
*/
@romuloctba
romuloctba / fb-page-feed.js
Created November 11, 2017 11:46 — forked from julienrf/fb-page-feed.js
A small js snippet retrieving the feed of a Facebook page and displaying its elements.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
<script src="http://connect.facebook.net/fr_FR/all.js"></script>
<script>
// Replace the id by any other public page id
FB.api('170913076256527/feed', { limit: 3 }, function(result) {
$('#fb-feed').empty();
$(result.data).each(function(i, post) {
entry = $('<div class="fb-item"></div>');
if (post.icon) {
entry.append('<img class="icon" src="' + post.icon + '" />');
@romuloctba
romuloctba / functions.php
Created October 14, 2017 20:50
Estados e cidades brasileiras populados em uma taxonomia do wordpress.
<?php
// É aconselhável criar um backup do banco antes
// crie a taxonomia cidade na functions do tema
add_action('init', 'register_locations');
function register_locations() {
register_taxonomy( 'cidade',array (
0 => 'locais',
),
array( 'hierarchical' => true,
@romuloctba
romuloctba / randdata.js
Created June 10, 2016 16:40 — forked from cristopher-rodrigues/randdata.js
mongo random find data
db.collection.find().limit(1).skip(_rand()*db.collection.count());
@romuloctba
romuloctba / mongod.service
Created May 31, 2016 13:17 — forked from benileo/mongod.service
Systemd Service Script for Mongod On Ubuntu 15.04+
[Unit]
Description=High-performance, schema-free document-oriented database
Documentation=man:mongod(1)
After=network.target
[Service]
Type=forking
User=mongodb
Group=mongodb