Microsoft Visual Studio Code Preview and .NET core on Linux

當微軟也開始擁抱開放原始碼、自由軟體、Linux,身為資訊人是該有些省思。

.NET Core如微軟先前所說支援Linux了,甚至連FreeBSD的版本都有(開發中),而目前丟在GitHub上的版本可用的.NET Core API已經有全部的45%了,相信很快就能到八成以上,詳情可參考.NET blog:
.NET Announcements at Build 2015
http://blogs.msdn.com/b/dotnet/archive/2015/04/29/net-announcements-at-build-2015.aspx

另外一件大事是Microsoft Visual Studio CodeVisual Studio的 … 兄弟?或說是一個比較初期的opensource版本,據說是based on GitHubatom editor
看來以後需要寫程式的課終於可已有一統江湖的IDE了?

官網:
https://www.visualstudio.com/en-us/products/code-vs.aspx

MicrosoftVisualStudioCodePreviewWebsite2
MicrosoftVisualStudioCodePreviewWebsite我自己裝起來玩的畫面,期待可以變得跟我們認識的Visual Studio愈來愈像XD?
MicrosoftVisualStudioCodePreview

一些安裝完系統後要做的一些設定

ntp server:
現在比較少看到學校單位自己在架ntp server了,至於要設定ntp校時伺服器的原因,原因很簡單,系統上錯誤的時間會產生的問題不少,小則查log的時候讓時間參考依據降低、大則讓你失約、線上搶購搶不到、甚至連網站都不能上(因為SSL憑證是要看日期的),而ntp server設的不好結果就是時間誤差大、查詢費時、或查不到東西,之前有整理過列表,可以參考下面這篇 – 台灣合用的ntp server,Windows內建的設定是time.windows.com,就是屬於很不好用的那種 … 強烈建議換掉,在系統時間設定裡面有選項,參考話面如下:
windowsNtp

dns server:
公司企業或是學校單位基本上都還是會有自己的dns,若非品質或速度有嚴重問題,建議以local的為主就可以了,之前有做過測試,想要自己測試也可以參考這邊做法 – 用Google的Public DNS上網會變快?Google的DNS真的比較快嗎?之常用DNS測試,因為dns實際上花費時間還要加上query的時間,有些人直接用ping值來當作dns的速度參考其實不太恰當 … 另外之錢也整理過一些列表: – 台灣ISP常用DNS列表整理常用 Public DNS 清單整理 (IPv4)

Windows WSUS / Linux/FreeBSD mirror:
Linux或BSD的套件或source來源mirror是一定要的,不用多解釋 … 而Windows上也有一種機制叫做WSUS – Windows Server Update Services,在做的就是類似的事情,對於企業或是學校環境來講可以省下非常可觀的頻寬跟時間花費

Windows 系統還原停用:
很多人不知道Windows有這功能,知道也不太會用,如果是這樣不如把這功能關掉,因為在背景自動備份吃的資源不是很划算,而真的中毒或系統損毀通常靠這功能是救不回來的 …

至於系統更新還有Windows需要的方毒軟體應該不用多解釋了,剩下想到再補XD

Fix inconsistent/broken pkgng on FreeBSD

Environment:
FreeBSD 10.1-RELEASE-p8 i386

Problem:

  • FreeBSD repository is up-to-date & all repositories are up-to-date, but when I try to install some package, it’ll try to fetch the non-latest version(so … 404 not found)
  • Keep getting message like this : pkg: cached package bind-tools-9.10.2: size mismatch, fetching from remote
  • pkd version said that there are some out-date packages, but pkg upgrade said every thing is up-to-update

pkg update -> not working
pkg clean + pkg update -> still not working
reboot -> of course not working …

So I did this to clean its cache:
$ sudo rm -rf /var/cache/pkg/*
and force update
$ sudo pkg update -f

Fortunately, it works fine now.

Virtualization related notes

Guest vs Host:

  • Host – usually runs on physical hardware, lower level.
  • Guest – runs on the virtual/virtualized environment, upper level.

Virtualization types:

  • Full virtualization –  virtualize all the devices!
    • Can run almost all the operating systems without any modifications.
    • Emulate all the devicesn.
    • Slower than Paravirtualization and Operating-system-level virtualization.
    • Software Emulation (Without Hardware-Assisted-Virtualization)
      • Very Slow.
      • Need to do some jobs like binary translation or software instruction decode, will have a heavy overhead, is very inefficiet.
    • Paravirtualization on HVM
      • Full virtualization with paravirtualization drivers.
  • Paravirtualization(PV) – use modified kernel to interact with the special interface
    • Guest knows it’s a guest on the host, the guest will communicate with hypervisor.
    • Use hypercall (call to hypervisor) as its system call.
    • Hard(almost impossible) to modify the kernel of closed-source operating systems like Windows to use this method.
    • Faster than full virtualization but slower than operating-system-level virtualization.
  • Hardware-Assisted-Virtualization (HVM, HAV)
    • Using help from hardware capabilities.
    • Faster than Software Emulation.
    • Technic examples
  • Operating-system-level virtualization – don’t really virtualize the devices
  • Partial virtualization – need be confirmed, not a usual type

Type-1 vs type-2 hypervisor:

Wikipedia also use Application/Environment and OS level to distinguish different types of virtualization:

  • Application-level
    • Sandbox
  • Environment-level
    • Containers
  • OS-level
    • Hypervisors

Common integrated virtualization solutions:

Resources and references:

The paravirtualization spectrum

source : https://blog.xenproject.org/2012/10/31/the-paravirtualization-spectrum-part-2-from-poles-to-a-spectrum/

Still learning, hope that there are not too many wrong things here … comments to point out mistakes/weak points are welcome!