Sails.js is a MVC Framework for Node.js
Create a new sails project
sails new {your-app-name}
Create a new Controller(apis)
sails generate api {generator-name}
VirMach, A ColoCrossing reseller. Good? Not bad. Cheap? Yes!
1 |
|
1 | --------------------------------- |
You may already find that two box above, one is AES-NI enabled but another one not.
When you reinstall your OS in VirMach’s SolusVM:
You can see some operating system is end with a gen2
If you install these gen2 template, your box will likely to enable the AES-NI. Even you reinstall to other OS later, the AES are still enabled.
Personlly, I install Debian 8 x 86_64 Minimal v1 (gen 2)
Since I recently learned about Nodejs, and I will probably focus on nodejs in the foreseeable future, I migrated my blog from Wordpress to Hexo.
Here is a little note about how to install a hexo blog.
This part you need to do it yourself.
Scoop is a package manager on Windows. Highly suggested.
Type the following into PowerShell to ensure that local scripts are allowed to execute.
set-executionpolicy remotesigned -scope currentuser
Then install Scoop by executing the following command.
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Just wait for the script to finish, and once it’s installed successfully, let’s try the following
scoop help
Finally install nodejs with scoop.
scoop install nodejs
Use npm to install hexo on your laptop:
npm install -g hexo-cli
Open the folder you want to store your blog data, then create a blog by using the following command:
hexo init [folder]
// [folder] = your blog’s path
Open the project folder with VSCode:
npm install
Finally,
hexo s
Open your browser and localhost:4000 to see your website
Follow the command provided by github:
Every git-push process need the following three commands:
1 | git add . |
You can open terminal on VSCode by clicking Ctrl+`
Well, I am lazy… and Netlify already did the job
To be continues…
“Good” path:
The number of routers a packet must go through
Associate a cost with each link
Topology of the network
Traffic load
Link cost
Information should always keep up-to-date
More information
Central Directory is usually stored at a network control center
Matrix table
No different between Datagram and VC
Advantages
Disadvantages
Packet sent to every neighbor node
No network information required
Evenually a number of copies will arrive at destination
Guarantees the packet reaches the destination in the shortest time
Duplicate packets are generated.
Node can remember packets already forwarded
Advantage
Disadvantage
The outgoing link is chosen at random
Round-robin?
Used by almost all packet switching network
** routing decision changes as network conditions change**
Failure Link
Network congestion
Require network information
Network information must be exchanged among the nodes
Decisions are more complex
Advantages
Disadvantages
Each node communicates only with directly-attached neighborsA routing table is created by building up a common set of routers in close proximity to each other, hence the term “distributed”.
Each router on the network must maintain a two-dimensional Vector Table, which records the best known distance from its own router to each router.
A router periodically builds a routing table by exchanging vector tables with neighboring routers (not broadcast to all routers).
When a router receives a vector table from its neighbors and then corrects its own vector table, the contents of the vector table are continually corrected and retransmitted, and the entire network state is gradually passed to each router.
As the routing tables on the routers become more complete, it becomes possible to find the best path. The vector table is sent only to the neighboring routers, which consumes less bandwidth and does not cause broadcast oscillation.
Information sharing - each router shares its knowledge of its neighbourhood with all routers in the network.
After all LASs from all nodes are gathered, the entire map of the network can be constructed.
We Will come back for the Algorithm later
Switching in computer network helps in deciding the best route for data transmission if there are multiple paths in a larger network
One-to-One connection
Network layer is concerned with getting packets from source all the way to destinations.
It is the lowest layer that deals with end-to-end transmission, and may make many hops at intermediate nodes.
Physical and data link layers only operate locally.
Jobs for sending side: encapsulates segments into datagrams
Jobs for receiving side: delivers segments to transport layer
Physical address
Logical address
Port address
Address of a node as defined by its LAN or WAN
In a data link level, frame transfer only contains Physical addresses in the header.
Most LAN use a 48-bit(6bytes) physical address written as 12 hexadecimal digits with every digits separated by a colon.
Physical Address also called Media Access Control (MAC) address
MAC address is performed via the Address Resolution Protocol (ARP)
Universal address that can pass through the LAN boundaries.
Address of a LAN. Logical Address + Physical Address needed to send data to another LAN network.
Computer can run multiple processes at the same time, but need to label different processes by using port address
Port address is 16-bit address. (2^16) 0 - 65535, 65536 in total.
Domain Name System
Translation of a hostname into an IP address.
More than one transport-later protocol available to applications
Internet: TCP and UDP
Full name: Transmission Control Protocol
Before any data transfer, TCP establishes a connection(hand shark?)
Full name : User Datagram Protocol
Good:
Good for: Streaming multimedia application
Each IPv4 have 4 byte, 5 classes
I should only focus on ABC here.
The 2-level hierarchy of IP addresses is not sufficient for organizations
We usually want to division of a network into smaller networks(subnet).
We have 3 level of IDs of hierarchy
In a subnet, Device can phtsically reach each other without intervening router.
Masking is the process of extracting the network address from an IP address
IP address Essentially a binary number
Example:11111111 00000000 00000000 00000000 = 255.0.0.0
Masking is AND
operation of the IP address
The 11111111
is the netID and the 0s
is HostID.
NetIDs are managed by Regional Internet Registries
The length of the network prefix in IP addresses is kept arbitrary.