Skip to content

Instantly share code, notes, and snippets.

View xetorthio's full-sized avatar

Jonathan Leibiusky xetorthio

  • New York, NY, USA
View GitHub Profile
@xetorthio
xetorthio / sjson.md
Created August 27, 2019 14:32 — forked from arrodriguez/sjson.md
Secure json middleware

Secure Json

Objetivo

El objetivo de secure json es proveer un mecanismo de seguridad e integridad de los objetos json devueltos por nuestras apis con enfasís en el acceso público. Cada petición o respuesta SJSON debe ser declarada en la definición SWAGGER de la api publicada.

Hay varios casos de uso en donde SJSON se puede utilizar:

  1. Mantener la seguridad y la integridad de los datos en una transacción "monetaria" pública.
  2. Asegurar que las peticiones y respuestas REST no sean manipuladas por un atacante.
Contact Information
https://admin.sherloq.io/c/MELI/#/moderations?id=20bd7b99-4f18-4c47-b79d-6f30bfdb4973
https://admin.sherloq.io/c/MELI/#/moderations?id=c12041e5-293c-44bb-b65d-6332df87ef2c
https://admin.sherloq.io/c/MELI/#/moderations?id=a5747069-5502-48ba-a8cb-2f6b7f5f8a3c
https://admin.sherloq.io/c/MELI/#/moderations?id=841a5eee-d552-4c51-9d97-e3536822ac53
https://admin.sherloq.io/c/MELI/#/moderations?id=a3e5c808-c9c2-43d4-b806-6dc34f1a5769
Forbidden items
https://admin.sherloq.io/c/MELI/#/moderations?id=edca271f-e4f5-43c3-83d8-8561fc063313
https://admin.sherloq.io/c/MELI/#/moderations?id=9902e47e-4e4d-4314-b869-987ed57fb21f
If elb healthy hosts is greater or equal than asg desired capacity, elb is OK
If elb healthy hosts is less than asg desired and greater or equal asg min capacity, elb is WARNING
If elb healthy hosts is less than asg min capacity, elb is UNHEALTHY
mtk health moderations
moderations-console: ok
moderations-api: ok
moderations-scoring-api: ok
mtk health -v moderations
package lalala;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
@xetorthio
xetorthio / gist:6377896
Created August 29, 2013 13:11
jump (by marquitos!)
export MARKPATH=$HOME/.marks
function j {
cd -P $MARKPATH/$1 2>/dev/null || echo "No such mark: $1"
}
function m {
mkdir -p $MARKPATH; ln -s $(pwd) $MARKPATH/$1
}
function um {
rm -i $MARKPATH/$1
}
@xetorthio
xetorthio / gist:3250540
Created August 3, 2012 19:13
OPTIONS
- Todos los campos de texto soportarán markdown
Estructura General:
{
name: "", //nombre del recurso
description: "", //descripción general del recurso
considerations: [], //consideraciones a tener en cuenta. es un array de strings. pueden ser reglas de negocio, etc.
attributes: {}, // información de los atributos
methods: {}, //métodos permitidos y ejemplos de cosas que se pueden hacer con cada uno
@xetorthio
xetorthio / gist:3061141
Created July 6, 2012 16:20
Test meli CORS support
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
</head>
<body>
<script>
$(document).ready(function() {
$.ajax({url:"https://api.mercadolibre.com/sites", dataType:"json"}).done(function(data) {console.log(data);}).fail(function(){console.log("error")});});
</script>
</body>
@xetorthio
xetorthio / gist:2578840
Created May 2, 2012 18:11
melidev TODO

MeliDev missing sections

  • Design considerations: dates in ISO 8601, Caching, Errors, JSONP, Pagination, Selection, Introspection,
  • Realtime updates
  • Authentication & Authorization
  • JS SDK
  • What can I do through the APIs?
  • Get in contact
  • How can I help?
  • How can I create my own app?
function isPrime(n) {
if (n<2) return false;
if (n==2) return true;
for (var i=2; i<n; i++) { if (n%i==0) return false; }
return true;
}
server {
listen 8080;
server_name xxx.yyy.com;
location / {
error_page 500 502 503 @fallback;
proxy_pass http://upstream1;
}
location @fallback {
proxy_pass http://upstream2;