2019年7月31日 星期三

centos 7

1. Change ssh Port 22

https://www.opencli.com/linux/centos-7-change-ssh-port-selinux-enable

2019年7月16日 星期二

hyper V

1. NetWork
https://dotblogs.com.tw/acelee/2018/07/18/191122

https://channel9.msdn.com/Series/Windows-Server-2012-Entry-Level/Windows-Server-2012-Entry-Level-5

https://ithelp.ithome.com.tw/articles/10128382

2019年7月15日 星期一

Ruby

0. Ruby install On windows

0-1 下載安裝exe,地址:http://rubyinstaller.org/downloads/
原文網址:https://kknews.cc/tech/pg3lx8.html


下載 DEvKit 表示可擴充的套件



ref:1 2


0-1 RubyGems簡介

RubyGemsRuby的套件管理系統,讓你輕易安裝及管理Ruby函式庫。你可以在RubyGems上找到所有的Ruby開源套件。另外,讀者如果想找RubyRails有哪些好用的套件,也可以瀏覽看看The Ruby Toolbox,這個站依照套件的熱門程度排序,非常方便。

常用指令

gem -v 告訴你 RubyGems 的版本
gem update --system 升級RubyGems的版本
gem install gem_name 安裝某個套件
gem list 列出安裝的套件
gem update gem_name 更新最新版本
gem update 更新所有你安裝的Gems
gem install -v x.x.x gemname 安裝特定版本
gem uninstall gem_name 反安裝

ref 1

0-2 Require Method

https://kaochenlong.com/2016/05/01/require/

Notice
require 'rubygems' will adjust the Ruby loadpath allowing you to successfully require the gems you installed through rubygems, without getting a LoadError: no such file to load -- sinatra.

In Ruby 1.9 'require "rubygems"' happens automatically. In previous Rubies rubygems is not automatically required and you will get the error. Your best bet is to automatically type it in unless you are sure you are running always in 1.9+. 


0-3 Install test
gem install mail
gem install win32-service






1. Ruby  totorail

https://railsbook.tw/chapters/02-environment-setup.html
https://ourcodeworld.com/articles/read/270/how-to-create-an-executable-exe-from-a-ruby-script-in-windows-using-ocra
http://ruby-for-beginners.rubymonstas.org/built_in_classes/symbols.html
https://openhome.cc/Gossip/Ruby/index.html


2. Data structure

Array:
["A string", 1, true, :symbol, 2]

Hash
{ "one" => "eins", "two" => "zwei", "three" => "drei" }


3. Class



4. Block

ref 1

block是用來暫存及傳遞程式碼的地方
它本身不是物件(但有方法可以讓它變物件,最後說明)所以必須掛在別人身上(可能是別的方法、別的物件


@users.each do |u|
...
end