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 / gist:0e0e5f7784846400082ed1fe8424524e
Created May 26, 2020 02:18
Usando ç no Manjaro com Notebook Asus Gringo
# /etc/environment
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
GTK_IM_MODULE=cedilla
@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 / readme.md
Created March 18, 2019 00:52
Docker Environment for Express 4 with typescript + MongoDB
  1. Create a bridge network for the containers docker network create app01net

  2. Run MongoDB Docker Container docker run --name mongoserver --network app01net mongo:latest This will make mongodb://mongoserver available (not port needed)

  3. Run NodeJS environment mkdir application docker run --rm -it -w="/usr/src/app" -p 3000:3000 -v $PWD/application:/usr/src/app:z --network app01net node:latest bash

@romuloctba
romuloctba / readme.md
Created February 20, 2019 17:20
WordPress Development Environment with Docker and Wp-Cli

1. Create DOcker container with MySQL version 5.7

$ docker run --name wp-mysql -v C:\my-docker-volumes\wp-mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=wp -d mysql:5.7

2. Create the WordPress container, by linking to created DB

$ docker run --name wp-docker --link wp-mysql:mysql -v C:\my-docker-volumes\wp-site\themes:/var/www/html/wp-content/themes -v C:\my-docker-volumes\wp-site\plugins:/var/www/html/wp-content/plugins -p 8080:80 -e WORDPRESS_MYSQL_PASSWORD=wp -d wordpress

3. Run WP-CLI commands using Docker

docker run -it --rm --volumes-from wp-docker --network container:wp-docker wordpress:cli user list docker run -it --rm --volumes-from wp-docker --network container:wp-docker wordpress:cli scaffold child-theme my-child --parent_theme=twentynineteen

@romuloctba
romuloctba / Readme.md
Created January 9, 2019 21:07
Disk 100% Windows 10 Service Host and System processes - Already disabled search, superfetch, cortana and other things but nothing worked untill this

I found this in a Microsoft Help Forum (https://answers.microsoft.com/en-us/windows/forum/windows_10-performance/service-host-local-system-constantly-using-cpu-and). I googled this issue for a long time, I tried scandisk, defrag, I also read many articles with 10 tips for fixing 100% disk and nothing really solved the issue until this.

Here is the answer that helped me: fucking WSReset.exe - IT RESETS THE GODAMN WINDOWS STORE and all the sudden the 100% disk went to 12%. Now is currently 4%, I am watching youtube stream and have a couple of tabs opened, also the Store. Now is 1% and then 6% etc. Amazing.

To run it, just type WSReset.exe on Run, on a terminal or even on a Windows Explorer address bar. It will take some time to run, and then load the windows store.

@romuloctba
romuloctba / Dockerfile
Created November 29, 2018 01:51
Photoshop on Docker
# docker run -it \
# -v /tmp/.X11-unix:/tmp/.X11-unix \
# -v $HOME:/workspace \
# -e DISPLAY=$DISPLAY \
# --privileged
# photoshop
#
FROM jess/wine
MAINTAINER Jonathan Gautheron <jgautheron@neverblend.in>
@romuloctba
romuloctba / Readme.md
Created November 26, 2018 00:29
Development Enviroment for NodeJS via Docker

docker run --rm -it -w="/usr/src/app" -v $PWD/application:/usr/src/app:z --user $(id -u):$(id -g) node bash

Add ports as needed, example:

docker run --rm -it -w="/usr/src/app" -p 8080:8080 -p 3000:3000 -v $PWD/application:/usr/src/app:z --user $(id -u):$(id -g) node bash

Example: Developing Angular Apps with Docker

docker run --rm -it -w="/usr/src/app" -p 4200:4200 -v $PWD/application:/usr/src/app:z --user $(id -u):$(id -g) node bash then create a new project inside the docker terminal

@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.