Skip to content

Instantly share code, notes, and snippets.

@ivaravko
ivaravko / x-factor-cnfs.md
Created September 21, 2018 20:09 — forked from fkautz/x-factor-cnfs.md
X-Factor CNFs

The community is currently in the process of defining Cloud-Native Network Functions (CNFs). Due to the differences between the current modern architecture and cloud-native environment, many questions will arise about how to create, consume, operate, monitor and scale CNFs. As CNFs gain in popularity, it will become increasingly important to have a set of guidelines to help the community maximize the benefit received from running in the new Cloud-Native environment.

When cloud-native arrived, it was often unclear how web applications should be designed or rearchitected to make use of cloud-native infrastructure. Many mistakes were repeated due to a lack of guidance. In response, Adam Wiggins and others created a methodology known as 12 Factor Apps. 12 factor apps guide developers towards building applications capable of taking advantage of cloud-native infrastructure. These properties include but are not limited to:

  • Easier on-boarding for developers
  • Maximize portability
  • Deploy on modern cloud platfor
1. Open a command prompt and navigate to /etc/nginx/ssl
2. issue "openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr"
3. Get your certificate - Go to your certificate authority and give them the CSR
4. copy your new crt to the /etc/nginx/ssl and give it read priveledges
5. reconfigure your nginx.conf, here is mine. The first part redirects 80 to 443, the second part listens to 443 and is optimized to return Ruby on Rails application requests using gzip and unicorn.

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html

Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.

Ruby

def do_something
yield 'something'
end
do_something do |thing|
puts thing
end
def do_complex(first, second)
thing = 'nothing'
server {
listen 80;
server_name nagios.example.tld;
access_log /var/log/nginx/nagios.access.log;
error_log /var/log/nginx/nagios.error.log info;
expires 31d;
root /usr/share/nagios3/htdocs;
worker_processes 1;
error_log /usr/local/var/log/nginx.error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
#!/bin/bash
# Install rbenv
# https://github.com/sstephenson/rbenv
cd ~
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> .bash_profile
echo 'eval "$(rbenv init -)"' >> .bash_profile
# -*- encoding : utf-8 -*-
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb)
namespace :deploy do
namespace :assets do
desc <<-DESC
Run the asset precompilation rake task. You can specify the full path \
to the rake executable by setting the rake variable. You can also \
module Plugin
def some_method
puts "Plugin"
super
end
end
class A
def some_method
puts "A"