Skip to content

Instantly share code, notes, and snippets.

Avatar

Yago yagop

  • Madrid, Spain
View GitHub Profile
@yagop
yagop / index.js
Created Oct 5, 2019
Navaja Negra 2019 - Mojo
View index.js
const crypto = require('crypto');
const vm = require('vm');
process.env.FLAG = "FLAG"
const secret = (key) => ((key == 1337) ? process.env.FLAG : 'fail');
const sandbox = {[crypto.randomBytes(32).toString('hex')] : secret};
const message = 'this.constructor.values(this).shift()(this.constructor.values(this.constructor).concat(this.constructor.values(this.constructor).concat(null).length).concat(this.constructor.values(this.constructor).concat(null).concat(null).concat(null).length).concat(this.constructor.values(this.constructor).concat(null).concat(null).concat(null).length).concat(this.constructor.values(this.constructor).concat(null).concat(null).concat(null).concat(null).concat(null).concat(null).concat(null).length).join(this.constructor.name.repeat()))';
// ...
if (message.match(/^[a-z.()]+$/)) {
try {
@yagop
yagop / LINKS.md
Last active Oct 2, 2018
Crytpo Links - Some links I use for crypto trading [WIP]
@yagop
yagop / a.sh
Last active May 8, 2018
Compile clang-format on Ubuntu Xenial Docker
View a.sh
docker run -w /root -it ubuntu:xenial-20180417 /bin/bash
apt update
apt install curl xz-utils cmake ninja-build g++ python -y
curl -o llvm-6.0.0.src.tar.xz http://releases.llvm.org/6.0.0/llvm-6.0.0.src.tar.xz
tar xvf llvm-6.0.0.src.tar.xz
cd llvm-6.0.0.src/tools/
curl -o cfe-6.0.0.src.tar.xz http://releases.llvm.org/6.0.0/cfe-6.0.0.src.tar.xz
tar xvf cfe-6.0.0.src.tar.xz
mv cfe-6.0.0.src clang
@yagop
yagop / .babelrc
Last active Dec 28, 2017
Webpack example
View .babelrc
{
"presets": ["env"]
}
@yagop
yagop / Readme.md
Last active Nov 15, 2017
Webtask bot sample
View Readme.md

This is a sample Telegram Bot to showcase Webtask.

Hints included

  • Main function promisification through Bluebird.try and asCallback.
  • Query params and body access.
  • Secrets (TG_TOKEN)
  • Get the Webtask runner URL
  • Basic Telegram Bot API usage

Setup

@yagop
yagop / README.md
Last active Oct 22, 2017
Simple example of WebTask Storage
View README.md

This example demostrate the usage of WebTask Storage with multiple models and how to save / filter / find them.

$ curl https://__host__.run.webtask.io/example\?action\=delete_all
{}

$ curl https://__host__.run.webtask.io/example\?action\=save_model \
  -H "Content-Type: application/json" \
  --data '{"modelName": "planets", "properties": {"name": "Earth"}}'
{}
@yagop
yagop / index.js
Last active Jun 27, 2017
Stream server
View index.js
const ts = require('tail-stream')
const http = require('http')
const PORT = 1234
const HOST = '0.0.0.0'
const FILE = 'info.log'
const server = http.createServer((req, resp) => {
const tstream = ts.createReadStream(FILE, {
beginAt: 0,
@yagop
yagop / insomnia.sh
Created Apr 21, 2017
Insomnia REST Client Arch installer
View insomnia.sh
#! /bin/bash
cd $(mktemp -d)
wget https://aur.archlinux.org/cgit/aur.git/snapshot/insomnia.tar.gz
tar xzf insomnia.tar.gz
cd insomnia
makepkg -s
sudo pacman -U insomnia-*-x86_64.pkg.tar
@yagop
yagop / node-js-app.service
Created Jan 7, 2017
Nodejs Systemd service example
View node-js-app.service
[Unit]
Description=Node.js App
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/node-v7.4.0/bin/node index.js
WorkingDirectory=/home/yago/produccion/app
Environment="HOST=127.0.0.1"
Environment="PORT=1234"
@yagop
yagop / emojis.js
Created Dec 25, 2016
Simple Twitter emoji streamer
View emojis.js
const emojisStr = '😀😂😅😆😇😘😍😜😎🤓😶😏🤗😐😡😟😞🙄☹️😔😮😴💤💩😭😈👿👌👸🎅👅👀👍💪👻🤖😺🐟🐠🐷🐌🐼🐺🐯🐅🦃🐕🐇🌾🎍🍀🐾🌏🌚🌝🌞🌦🔥💥☃️✨❄️💧🍏🍊🍌🌽🍔🌮☕️🍧⚽️🏐🎖🎹🎰🎣🏓🚵🎮🎬🚗🚓🚨🚋🚠🛥🚀🚢🎠🚧🚧🚧✈️🏥📱⌨💻📠📞🔦💴💸🔮💊🔬🔭📫📈📉🖇✂️🔒🔓📒💛❤️💙💔💞💕💝💘🚾⚠️♻️🎵💬🕐🇬🇧🇺🇸🇪🇸🇵🇹🇳🇺🇳🇷🇬🇾🇬🇦🇮🇸🇯🇵';
const emojis = [...emojisStr]
.filter(emoji => emoji.length > 0)
.filter(emoji => emoji !== '\uFE0F');
module.exports = emojis;
You can’t perform that action at this time.