- Node - a physical or virtual machine that hosts services
- Nodes also referred to as members.
- Examples
- Your computer
- An AWS EC2 instance
- A bare metal machine in your private data center
- Service - executing software that provides utility via an interface
- Typically long-lived process listening on a port(s)
- Examples
- A web server (nginx, apache, iis)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
output = {} | |
s_json = JSON.parse(Net::HTTP.get_response(URI.parse('http://localhost:8500/v1/catalog/services')).body) | |
services = s_json.keys.reject{|k| k == 'consul'} | |
services.each do |srv| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @providesModule PatientList | |
*/ | |
import NavigationBar from 'react-native-navbar'; | |
import NavigationButtons from 'NavigationButtons'; | |
import React, { ListView, Navigator, StyleSheet, Text, TextInput, TouchableHighlight, View } from 'react-native'; | |
import { connect } from 'react-redux/native' | |
@connect(state => ({ | |
patients: state.patients |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you see the error message below, you may need this patch: | |
Undefined symbols for architecture x86_64: | |
"_tun_close", referenced from: | |
_tuntap_open in n2n.a(tuntap_osx.o) | |
ld: symbol(s) not found for architecture x86_64 | |
# How to use | |
If you got the source code from official repository, like me: | |
svn co https://svn.ntop.org/svn/ntop/trunk/n2n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ag "sometext" --nogroup | awk '{print substr($1,1,index($1,":")-1);}' | xargs -I {} sed -i .bak -e 's/sometext/anothertext/g' {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream node_backend { | |
server 127.0.0.1:3000; | |
keepalive 32; | |
} | |
server { | |
root /var/www/testapp/public; | |
index index.html; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: IE={box} vagrant up | |
# | |
# Eg. IE=XPIE6 vagrant up | |
boxes = { | |
"XPIE6" => "http://aka.ms/vagrant-xp-ie6", | |
"XPIE8" => "http://aka.ms/vagrant-xp-ie8", | |
"VistaIE7" => "http://aka.ms/vagrant-vista-ie7", | |
"Win7IE8" => "http://aka.ms/vagrant-win7-ie8", | |
"Win7IE9" => "http://aka.ms/vagrant-win7-ie9", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function* runTimer(getState) { | |
while(yield take('START')) { | |
while(true) { | |
const {stop, tick} = yield race({ | |
stop : take('STOP'), | |
tick : call(wait, ONE_SECOND); | |
}) | |
if ( !stop ) { | |
yield put(actions.tick()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Vim | |
### Basic | |
enable line numbers :set number | :set nu | |
disable line numbers :set nonumber | :set nonu | :set nu! | |
enable relative numbers :set relativenumber | |
convert entire word to uppercace <leader>u | |
convert entire word to lowercase <leader>l | |
convert first char of word to uppercase <leader>U | |
convert first char of word to lowercase <leader>L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React, { | |
AppRegistry, | |
Component, | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity, | |
LayoutAnimation, | |
} from 'react-native'; |
OlderNewer