Skip to content

Instantly share code, notes, and snippets.

View jpopesculian's full-sized avatar

Julian Popescu jpopesculian

View GitHub Profile
@jpopesculian
jpopesculian / prod.sh
Last active February 11, 2016 17:46
Setting up a production environment for rocket chat
# CONFIG PORTS
METEOR_PRIMARY_PORT=3001
METEOR_SECONDARY_PORT=3002
MONGO_PRIMARY_PORT=28001
MONGO_SECONDARY_PORT=28002
MONGO_ARB_PORT=28003
# DOCKER CONTAINER NAMES
MONGO_PRIMARY_NAME="mongo-primary"
MONGO_SECONDARY_NAME="mongo-secondary"
@jpopesculian
jpopesculian / webrtc-options.md
Created January 25, 2016 21:31
Large Scale WebRTC Broadcast

Large Scale WebRTC Broadcast

The Problem

WebRTC is a protocol that has been standardized in recent years among major browsers like Chrome, Firefox, Opera and the Android Browsers. Plugins/Native Implementations are available on IE/Edge/Safari and iOS/Android basically providing a relatively global protocol for real time media streams. However WebRTC is a P2P protocol which means that if a user wishes to broadcast his/her video to multiple users he/she needs to individually send that broadcast to each participant. This works on a small scale, but degrades quickly on a large scale due to bandwidth deterioration.

The Solution

One possible solution is to let the user stream his/her media to a server and the server in turn splits the media streams to the subscribers. There are two technical ways to do this. A Selective Forwarding Unit (SFU) which simply forwards streams, and a Multipoint Control Unit (MCU) which essentially does the same thing but lowers bandwidth usage by packaging streams together.

@jpopesculian
jpopesculian / index.js
Created January 25, 2016 17:39
Some scripts for Stripe and RocketChat diffs
const Stripe = require('stripe')
const MongoClient = require('mongodb').MongoClient
const diff = require('deep-diff').diff
const assert = require('assert')
const STRIPE_KEY = process.env.STRIPE_KEY
const MONGO_URL = process.env.MONGO_URL
MongoClient.connect(MONGO_URL, (err, db) => {
assert.equal(err, null)
@jpopesculian
jpopesculian / register_users.py
Last active December 6, 2022 12:32
Python Script to Register Users for rocket chat
import requests
HOST = "http://localhost:3000"
ADMIN_USERNAME = "jpopesculian"
ADMIN_PASS = "password"
NUM_USERS = 500
NUM_ROOMS = 2
@jpopesculian
jpopesculian / addUsersToRooms.js
Created January 5, 2016 19:33
Mongo Shell Script to add users to rooms in Rocket Chat
// Mongo Shell Script
DB_NAME = ""
// HOST = "localhost"
// PORT = "27017"
// db = connect(HOST + ":" + PORT + "/" + DB_NAME)
conn = new Mongo()
db = conn.getDB(DB_NAME)
@jpopesculian
jpopesculian / keybase.md
Created November 21, 2015 21:22
Keybase Proof

Keybase proof

I hereby claim:

  • I am jpopesculian on github.
  • I am jpopesculian (https://keybase.io/jpopesculian) on keybase.
  • I have a public key whose fingerprint is F352 E523 51D1 77AE 862C 27C5 B66E 62C3 1A7B 7846

To claim this, I am signing this object:

@jpopesculian
jpopesculian / etf.py
Created March 14, 2015 22:14
ETFSpider
from scrapy import Spider, Request
from project.items import ETFItem
class ETFSpider(Spider):
name = "etf"
allowed_domains = ["http://finance.yahoo.com/"]
SETTINGS = {
"url": "http://finance.yahoo.com/etf/lists?mod_id=mediaquotesetf&tab=tab6&scol=nasset&stype=desc&rcnt=100&page=",
"num_pages": 17
}
@jpopesculian
jpopesculian / circle.coffee
Last active August 29, 2015 13:56
A simple circle directive for angular google maps
###
!
The MIT License
Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell