Skip to content

Instantly share code, notes, and snippets.

View rkmax's full-sized avatar

Julian Reyes Escrigas rkmax

View GitHub Profile
import PropTypes from 'prop-types'
const Note = (props) => (
<div>~{props.content.title}</div>
)
const Notes = (props) => (
<div>
There are {props.notes.length} Notes
{props.notes.map(note => <Note {...note}/>)}
1. Download and install NVIDIA-Linux-x86_64-390.48.run
2. enable multilib repository
2. install lib32-libx11 lib32-glibc lib32-glib2
@rkmax
rkmax / jwtRS256.sh
Created January 14, 2018 22:13 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
#!/usr/bin/env python
# Try to determine how much RAM is currently being used per program.
# Note per _program_, not per process. So for example this script
# will report RAM used by all httpd process together. In detail it reports:
# sum(private RAM for program processes) + sum(Shared RAM for program processes)
# The shared RAM is problematic to calculate, and this script automatically
# selects the most accurate method available for your kernel.
# Licence: LGPLv2
@rkmax
rkmax / supervisord
Last active June 22, 2018 03:27
A Supervisor init script for Amazon Linux
#!/bin/bash
#
# supervisord This scripts turns supervisord on
#
# Author: Mike McGrath <mmcgrath@redhat.com> (based off yumupdatesd)
# Jason Koppe <jkoppe@indeed.com> adjusted to read sysconfig,
# use supervisord tools to start/stop, conditionally wait
# for child processes to shutdown, and startup later
# Mikhail Mingalev <mingalevme@gmail.com> Merged
# redhat-init-jkoppe and redhat-sysconfig-jkoppe, and
@rkmax
rkmax / 1-main.js
Created September 4, 2017 09:38 — forked from leaysgur/1-main.js
passwordless auth0 with amazon cognito
// const auth0 = require('auth0-js');
const webAuth = new auth0.WebAuth({
domain: '<YOUR_DOMAIN>',
clientID: '<YOUR_CLIENT_ID>',
});
@rkmax
rkmax / ssh-tunnel-cheat-sheet.md
Created May 2, 2017 20:56 — forked from jkullick/ssh-tunnel-cheat-sheet.md
SSH Tunnel Cheat Sheet
# $LOCAL_IP: 'localhost' or machine from local network
# $LOCAL_PORT: open port on local machine
# $REMOTE_IP: remote localhost or IP from remote network
# $REMOTE_PORT: open port on remote site

# Forward Tunnel: map port from remote machine/network on local machine
ssh -L $LOCAL_PORT:$REMOTE_IP:$REMOTE_PORT $USER@$SERVER

# Reverse Tunnel: make local port accessable to remote machine
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
background: red;
}
fs.writeFile('/tmp/a.txt', 'data', function(err, result) => {
fs.writeFile('/tmp/b.txt', 'data', function(err, result) => {
fs.writeFile('/tmp/c.txt', 'data', function(err, result) => {
fs.writeFile('/tmp/d.txt', 'data', function(err, result) => {
console.log('exito!');
});
});
});
});
@rkmax
rkmax / lib.facebook.js
Last active October 17, 2016 21:10
Crear sesion usando facebook
var fbGraph = require('fbgraph');
var FACEBOOK_APP_ID = process.env.FACEBOOK_APP_ID;
var FACEBOOK_APP_SECRET = process.env.FACEBOOK_APP_SECRET;
function validateTokenAndGetProfile(token, cb) {
fbGraph.setAccessToken(token);
fbGraph.setAppSecret(FACEBOOK_APP_SECRET);
fbGraph.get('/me?fields=id,email,name,gender,bio,picture.type(large)', function(err, result) {
if (err) return cb(new Error(err.message));
cb(null, result);