| gitflow | git |
|---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
| import gql from 'graphql-tag' | |
| import { Mutation } from 'react-apollo' | |
| export const UPLOAD_FILE = gql` | |
| mutation uploadFile($file: Upload!) { | |
| uploadFile(file: $file) { | |
| filename | |
| } | |
| } | |
| `; |
| # Advanced config for NGINX | |
| server_tokens off; | |
| add_header X-XSS-Protection "1; mode=block"; | |
| add_header X-Content-Type-Options nosniff; | |
| # Redirect all HTTP traffic to HTTPS | |
| server { | |
| listen 80; | |
| server_name www.domain.com domain.com; | |
| return 301 https://$host$request_uri; |
Just documenting docs, articles, and discussion related to gRPC and load balancing.
https://github.com/grpc/grpc/blob/master/doc/load-balancing.md
Seems gRPC prefers thin client-side load balancing where a client gets a list of connected clients and a load balancing policy from a "load balancer" and then performs client-side load balancing based on the information. However, this could be useful for traditional load banaling approaches in clound deployments.
https://groups.google.com/forum/#!topic/grpc-io/8s7UHY_Q1po
gRPC "works" in AWS. That is, you can run gRPC services on EC2 nodes and have them connect to other nodes, and everything is fine. If you are using AWS for easy access to hardware then all is fine. What doesn't work is ELB (aka CLB), and ALBs. Neither of these support HTTP/2 (h2c) in a way that gRPC needs.
Using the -ldflags parameter can help set variable values at compile time.
Using the example provided here:
- Running
make buildwill create abuildexecutable. Running it will result in:
$> ./build
no version (Mon YYYY)
$>| var db = mongoose.connect('mongodb://localhost:27017/DB'); | |
| // In middleware | |
| app.use(function (req, res, next) { | |
| // action after response | |
| var afterResponse = function() { | |
| logger.info({req: req}, "End request"); | |
| // any other clean ups |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
| const buffer = require('buffer'); | |
| const crypto = require('crypto'); | |
| // Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib. | |
| const aes256gcm = (key) => { | |
| const ALGO = 'aes-256-gcm'; | |
| // encrypt returns base64-encoded ciphertext | |
| const encrypt = (str) => { | |
| // Hint: the `iv` should be unique (but not necessarily random). |
| // from https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=fbb7daec1be993d3a4cd6f6181f332a0 | |
| use std::future::Future; | |
| use std::pin::Pin; | |
| use std::thread; | |
| use futures::future::{pending, poll_fn}; | |
| use lazy_static::lazy_static; | |
| use tokio::runtime::{Handle, Runtime}; |
| var readline = require('readline'), | |
| rl = readline.createInterface(process.stdin, process.stdout); | |
| rl.setPrompt('OHAI> '); | |
| rl.prompt(); | |
| rl.on('line', function(line) { | |
| switch(line.trim()) { | |
| case 'exit': | |
| rl.close(); |