Skip to content

Instantly share code, notes, and snippets.

View DiegoRBaquero's full-sized avatar

Diego Rodríguez Baquero DiegoRBaquero

View GitHub Profile
var spawn = require('electron-spawn');
var electron = spawn('seeder.js', {
detached: false
});
electron.stderr.on('data', function (data) {
console.error(data.toString())
});
@DiegoRBaquero
DiegoRBaquero / tracker.btorrent.xyz.nginx-conf
Last active September 4, 2018 15:38
btorrent's tracker nginx conf
server {
listen 443 ssl spdy;
listen [::]:443 ssl spdy;
server_name tracker.btorrent.xyz;
ssl_certificate /etc/nginx/ssl/tracker.btorrent.xyz.crt;
ssl_certificate_key /etc/nginx/ssl/tracker.btorrent.xyz.key;
location / {
proxy_pass http://127.0.0.1:8000;
@DiegoRBaquero
DiegoRBaquero / createInstall.sh
Created May 8, 2016 11:30
Install create-torrent NPM module
npm i -g create-torrent
@DiegoRBaquero
DiegoRBaquero / demo.html
Created May 8, 2016 11:36
Stream Alpine Timedrift WebTorrent with Webseed
<html>
<body>
<script src="https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js"></script>
<script>
var client = new WebTorrent()
client.add('https://webseed.btorrent.xyz/timedrift-alpine-4k-timelapse.mp4.torrent', function (torrent) {
// Got torrent metadata!
console.log('Client is downloading:', torrent.infoHash)
@DiegoRBaquero
DiegoRBaquero / demo2.html
Created May 8, 2016 19:04
File Download with WebTorrent
<html>
<body>
<script src="https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js"></script>
<script>
var client = new WebTorrent()
client.add('https://webseed.btorrent.xyz/juanpabloaj/other-page.torrent', function (torrent) {
// Got torrent metadata!
console.log('Client is downloading:', torrent.infoHash)
torrent.files[0].getBlobURL(function(err, url) {
if (err) return console.log(err)
@DiegoRBaquero
DiegoRBaquero / uws.js
Last active October 14, 2016 07:12
Swap ws with uws
require('ws') // before
require('uws') // after
@DiegoRBaquero
DiegoRBaquero / bench.log
Created November 23, 2016 04:44
VPSCheap Benchmark Log
System Info
-----------
Processor : Intel(R) Xeon(R) CPU E5-1620 0 @ 3.60GHz
CPU Cores : 4
Frequency : 3600.013 MHz
Memory : 4096 MB
Swap : MB
Uptime : 1 day, 12:12,
OS : Ubuntu 16.04.1 LTS
@DiegoRBaquero
DiegoRBaquero / init.sh
Created December 24, 2016 18:23
Ubuntu 16.04 with latest NodeJS 6 & latest nginx
apt-get update && apt-get upgrade
# Latest LTS NodeJS Repo
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
# Latest nginx repo
echo "deb http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list.d/nginx.list
echo "deb-src http://nginx.org/packages/ubuntu/ xenial nginx" >> /etc/apt/sources.list.d/nginx.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ABF5BD827BD9BF62
@DiegoRBaquero
DiegoRBaquero / gist:24e2e29e7be40905ad3f083bfb79ee69
Last active November 9, 2017 00:18
Calificación rápida de cursos en Banner
let calificacion = 4 // Cambiar por el valor deseado {1,2,3,4}
for(let i = 1; i <=33; i++) { if(i === 17) continue; $(`input[value="${i}-${calificacion}"]`).click() }
@DiegoRBaquero
DiegoRBaquero / express-debug-async-wrap.js
Created January 20, 2018 18:58
express-debug-async-wrap
module.exports = debug =>
fn =>
(req, res, next) =>
fn(req, res, next)
.catch(e => {
e.status = e.status || 400
e.debug = debug
next(e)
})