- Install target mingw-w64:
brew install mingw-w64
- Add target to rustup:
rustup target add x86_64-pc-windows-gnu
- Create
.cargo/config
- Add the instructions below to
.cargo/config
[target.x86_64-pc-windows-gnu]
version: '3.8' | |
services: | |
# Database - Mongo DB | |
mongo: | |
image: mongo | |
environment: | |
MONGO_INITDB_ROOT_USERNAME: helpdev | |
MONGO_INITDB_ROOT_PASSWORD: 123456 |
brew install mingw-w64
rustup target add x86_64-pc-windows-gnu
.cargo/config
.cargo/config
[target.x86_64-pc-windows-gnu]
Promise.all([ | |
Product.create({ | |
name: 'MacbookPro', | |
qty: 1232213, | |
price: 10000. | |
}), | |
Order.findOne({ | |
orderNumber: 123 | |
}) | |
]) |
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
import React from 'react' | |
import axios, { post } from 'axios'; | |
class SimpleReactFileUpload extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state ={ | |
file:null | |
} |
// NOTE: this adds a filename and line number to winston's output | |
// Example output: 'info (routes/index.js:34) GET 200 /index' | |
var winston = require('winston') | |
var path = require('path') | |
var PROJECT_ROOT = path.join(__dirname, '..') | |
var logger = new winston.logger({ ... }) | |
// this allows winston to handle output from express' morgan middleware |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.ng-modal-overlay { | |
/* A dark translucent div that covers the whole screen */ | |
position:absolute; |
Letsencrypt is an initative which aims to increase the use of encryption for websites. It basically allows people to apply for free certificates provided that they prove the they control the requested domain. We will look at the what is needed to secure your MongoDB installation. For more details on setting up a MongoDB server see MongoDB 3.2.x.
We sould to set the hostname to match the name of the certificate we are going to optain.
sudo hostname mongo0.example.com
Then update the hostname file to set the server name permanently.
#MongoDB 3.2.x Replica Sets on AWS EC2 A MongoDB replica set provides a mechanism to allow for a reliable database services. The basic replica set consists of three servers, a primary, a secondary and an arbitrator. The primary and secondary both hold a copy of the data. The arbitrator is normally a low spec server which just monitors the other servers and help with the failover process. In production, there can be more than three servers.
To setup mongo as a replica set on Amazon Web Services EC2 you need to first setup a security group with ssh on port 22 and mongodb on port 27017. You then need to create three servers. Select Ubuntu 14.04 LTS x64 and a micro (or bigger depending on your database size, ideally you should have enough memory to match your database size) instance for the primary and secondary and a nano instance for the arbitrator.
##Adjust the File System on each Server The operating system by default will update the last access time on a file. In a high data throughput database application
mongoserver:PRIMARY> rs.status(); | |
{ | |
"set" : "mongoserver", | |
"date" : ISODate("2016-02-02T10:47:07.510Z"), | |
"myState" : 1, | |
"members" : [ | |
{ | |
"_id" : 3, | |
"name" : "192.168.1.10:37017", | |
"health" : 1, |