Skip to content

Instantly share code, notes, and snippets.

View alex3er's full-sized avatar

alexx3 alex3er

View GitHub Profile
@alex3er
alex3er / mongodb-s3-backup.sh
Created December 22, 2020 06:40 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@alex3er
alex3er / t
Created December 2, 2020 03:19
pagenation
router.get("/users", authChecker, async function (req, res, next) {
const page = parseInt(req.query.page || 1);
const limit = 100;
const skip = (page - 1) * limit;
const totalDocuments = await UserModel.countDocuments();
const totalPages = Math.ceil(totalDocuments / limit);
const range = [];
const rangerForDot = [];
const detal = 1;
@alex3er
alex3er / readme.md
Created October 3, 2020 07:44 — forked from jdrew1303/readme.md
Market Order Matching Engine

Introduction

The computer driven markets for instruments like stocks and exchange traded stock options, have transformed finance and the flow of capital. These markets are enabled by order matching engines (and the infrastructure that supports this software). Before computer trading networks and matching engines, stocks where traded on cavernous exchange floors and transaction costs where high. When electronic trading fully matured, floor traders were a fading anachronism and transaction costs had been reduced to pennies a share in many cases. Electronic trading could not exist without advanced network infrastructure, but without the software matching engines no shares would change hands. The computer trading networks, the matching engine software has also created a concentrated nexus of potential failure. Failures in these systems have increased as the frequency and volume on the electronic networks has increased. The position of order matching engines in the trading infrastructure makes these systems o