2018年3月18日 星期日

[工商服務_NS遊戲]外界清單更新20180318]

https://docs.google.com/spreadsheets/d/1diHDSew41eaR33kCymQlGbwUpPfbfCePl28Z4FLjxPY/edit?usp=sharing

2017年1月29日 星期日

如何在Mac下建立.net環境


1.安裝Install Homebrew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
參考網址:https://www.microsoft.com/net/core#macos.

2.執行https://www.microsoft.com/net/core#macos的1.Install pre-requisites及2.
Install .NET Core SDK.

3.從visual studio code擴充功能Install the C# extension及c#.

4.自行建立一個存放.net專案的資料夾.

5.打開終端機切換到4.建立的位置.

6.執行dotnet new建立一個Program.cs檔案,內含hello world.

7.執行dotnet restore進行編譯會產出兩個檔案,分別是project.json及project.lock.json.

8.執行dotnet run在終端機畫面上產出hello world.

以上使用c#去編寫.net

參考網址:https://code.visualstudio.com/docs/runtimes/dotnet

2016年7月21日 星期四

python-url download code

import urllib2
import os
url = ('')
file_name = url.split('/')[-1]
u = urllib2.urlopen(url)
f = open(file_name, 'wb')
meta = u.info()
file_size = int(meta.getheaders("Content-Length")[0])
print "Downloading: %s Bytes: %s" % (file_name, file_size)

file_size_dl = 0
block_sz = 8192
while True:
    buffer = u.read(block_sz)
    if not buffer:
        break

    file_size_dl += len(buffer)
    f.write(buffer)
    status = r"%10d [%3.2f%%]" % (file_size_dl, file_size_dl * 100. / file_size)
    status = status + chr(8)*(len(status)+1)
    print status,

f.close()

python-telnet code

import telnetlib

print("beta version:1,date:2016/5/22")
x = raw_input(">>> Input Host IP to test: ")
y = raw_input(">>> Input Port to test: ")
tn = telnetlib.Telnet(x, y)
tn.write(b"ipconfig\n")
tn.write(b"exit\n")
print("test is ok~~~~~~~~~~\n"+tn.read_all().decode('ascii'))
try:
    input("Press enter to continue")
except SyntaxError:
    pass

2016年2月13日 星期六

python IndentationError:expected an indented block

撰寫python時遇到了

IndentationError:expected an indented block

經過google搜尋後查到下面這篇來暫時解決問題,但是沒想到tcp&udp client擷取封包的工具程式也有問題,這下有得除錯了.

http://blog.csdn.net/hongkangwl/article/details/16344749 

2016年2月12日 星期五

Mac上撰寫Python的方式

[轉貼]金魚人備忘錄: 【Python】在XCode上寫python
http://celinechiu0809.blogspot.tw/2015/07/pythonxcodepython.html 
 
sublime test 3安裝python相關設定筆記:
1.安裝Package Control https://packagecontrol.io/installation#st3
2.安裝SublimeREPL,環境設定部分目前沒用到,參考網址:https://packagecontrol.io/packages/SublimeREPL

2015年5月4日 星期一

[心得]免費的Final Cut Pro X套件-Timecode

首先到這連結http://fxfactory.com/download/下載FxFactory的程式如下圖,選擇免費TimeCode下載安裝.
再開啟FCP X在影片時間軸上就能看到如下圖的TimeCode套件顯示了,真的值得安裝上.
原文網址連結: http://www.fcp.co/final-cut-pro/news/1657-timecode

2015年5月3日 星期日

[心得]Photon by VMware

在Docker逐漸盛行後連VMware都推出專屬執行Docker容器(container)的免費平台名叫Photon,官方說明如下:
Photon™ is a technology preview of a minimal Linux container host. It is designed to have a small footprint and boot extremely quickly on VMware platforms. Photon™ is intended to invite collaboration around running containerized applications in a virtualized environment.
主要的功能:
Optimized for vSphere
Container support 
Efficient lifecycle management
針對使用vSphere優化、容器支援、生命週期管理.
官網下載映像檔後並非需要在VMware的免費的Esxi或是收費的vSphere,在Virtualbox上也能掛載安裝,接著是安裝過程.

1.使用VirtualBox 5.0 Beta來示範.
2.授權畫面.
3.選擇磁碟空間進行安裝.
4.上步完成後選擇yes後開始安裝.
5.這裏選擇Photon安裝方式,如果沒意外請選全部安裝,不用擔心會安裝到不需要的套件,因為他真的就是多餘套件都沒有的minimal Linux container host.
6.輸入本機名稱,安裝過Unix-Like的一定非常熟這畫面.
7.輸入root密碼,這裏沒辦法輸入過於簡單的密碼.
8.安裝Photon的minimal Linux container套件.
9.安裝完後會重新開機,這時候你就能在minimal Linux container下直接執行Docker了,CentOS7下還需要下指令安裝.
Photon官網網址: https://vmware.github.io/photon/

[心得]Visual Studio Code for Mac建立Node.js與ASP.NET5的基本環境

微軟在日前實現了在Linux與Mac上也能使用Visual Studio的可能性,接著當然就是找時間來玩一下.
1.在安裝Visual Studio Code前,先選擇自己要安裝Node.js source code的平台,下載連結: https://nodejs.org/download/
2.安裝web framework for Node.js的套件,指令:sudo npm install -g express(sudo看你自己決定是否加入,本人已經慣用sudo來操作任何Unix-Like系統,不直接使用root).
3.安裝the express application generator,指令:sudo npm install -g express-generator.
4.建立輸出資料夾,指令:express myExpressApp.

5.切換到剛剛建立輸出程式的資料夾並安裝測試程式.
6.最後在瀏覽器開啟http://localhost:3000就能看到測試程式顯示的結果.
以上Node.js基本環境已經建構完成,如果還有興趣請參考官方連結: https://code.visualstudio.com/docs/nodejs
7.接著建立ASP.NET5的基本開發環境,指令: sudo npm install -g yo grunt-cli generator-aspnet bower.
8.一樣執行官方的測試程式,指令: yo aspnet.
以上環境架構完成了,一樣有興趣請參考官方連結: https://code.visualstudio.com/docs/ASPnet5.
能在Linux與Mac上玩到Visual Studio是件令人高興的事,雖然他只是簡易版卻拉近其他作業系統的程式開發人員,改變開發微軟程式環境的可能性.

2015年4月19日 星期日

[心得]Virtualbox下安裝virtualbox tools

1.安裝virtualbox所需要的套件.
yum install dkms binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-pae-devel -y
2.建立資料夾.
mkdir /media/cdrom
3.掛載光碟機.
mount /dev/sr0 /media/cdrom
4.切換到光碟機並執行virtual box tools sh.
cd /media/cdrom
sh ./VBoxLinuxAdditions.run
5.重新開機.

reboot

2015年4月14日 星期二

[工商服務] 威力導演"PowerDirector12 LE"版下載

http://sharewareonsale.com/s/cyberlink-powerdirector-sale

[資訊]Apple update Final Cut Pro X to 10.2, Motion to 5.2 and Compressor to 4.2&Free stock videos – Pexels Videos

1.Apple update Final Cut Pro X to 10.2, Motion to 5.2 and Compressor to 4.2
新增了下列功能與強化
3D Titles
Smart Collections
Draw Mask
Color Correction is now an Effect.
New Scope Display Options
New Import Window
Improved Processing of Waveforms
New XML Version 1.5
Faster RED Workflow
Send to Compressor
More Video Formats Supported
Other Improvements, Features 7 Bug Fixes
http://www.fcp.co/final-cut-pro/news/1642-apple-update-final-cut-pro-x-to-10-2-motion-to-5-2-and-compressor-to-4-2

2.Free stock videos – Pexels Videos
https://videos.pexels.com/

2015年4月6日 星期一

[Docker心得]網卡混亂模式設定篇

首先本次操作是在CentOS7 64bit上,反正早晚都要熟悉新版指令不如提早開始.

Promiscuous是混雜模式,是指對目的硬體位址不加任何檢查,全部接收的工作模式 .

1.之前的ifconfig -a這指令在CentOS7上已經改成下列指令
$ip a
懷舊的朋友可以下:sudo yum -y install net-tools安裝完後即可下達ifconfig,提醒之後的CentOS版也不會有ifconfig的指令了早點習慣新版.
指令下完後看一下docker0這個虛擬的網路介面,注意""內的文字,這裏是標注提醒不會真的顯示在你的畫面上.
3: docker0: <"NO-CARRIER,BROADCAST,MULTICAST,UP"> mtu 1500 qdisc noqueue state DOWN

2.把docker的虛擬網路卡停止
ip link set dev docker0 down






3.再次觀察docker的虛擬網路卡的變化
ip a
3: docker0: <"BROADCAST,MULTICAST"> mtu 1500 qdisc noqueue state DOWN








4.查看自己設備上網卡名稱
vi /etc/sysconfig/network-scripts/ifcfg-<host_network>


5.啟動混亂模式
ip link set eth0 promisc on

6.觀察是否正確啟動
ip a
2:<host_network>: <“BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP”> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:50:56:81:22:12 brd ff:ff:ff:ff:ff:ff

基本上以上完成就能ping到docker0這張虛擬網卡了.
再來的Docker橋接跟固定IP設定就另開一篇來討論了,目前也卡住在固定IP設定.

2015年3月28日 星期六

[Docker心得]在Centos6與Centos7安裝的差異比較

到目前為止,如果使用Centos7安裝Docker記得images使用cnetos6的版本會比較好一點,光卡在systemctl上就能卡很久了,待續.

1.Centos6安裝步驟
1.1首先要安裝上EPEL後才能安裝Docker,所以6以後的版本就不建議玩Docker了.
sudo wget http://download.fedoraproject.org/pub/epel/4/x86_64/epel-release-4-10.noarch.rpm

1.2下載完RPM檔後,就安裝了.
sudo rpm -ivh epel-release-4-10.noarch.rpm

1.3安裝完RPM檔後一定要更新.
sudo yum repolist


1.4接著移除Centos6上的docker(這步必要不管是剛剛裝完OS,或是舊有版本安裝docker).
sudo yum -y remove docker

1.5安裝Docker.
sudo yum install docker-io

1.6啟動Docker服務.
sudo service docker start

1.7設定Docker服務常駐.
sudo chkconfig docker on

Docker官方安裝參考連結 https://docs.docker.com/installation/centos/

2.Centos7安裝步驟

2.1安裝Docker.
sudo yum -y install docker docker-registry

2.2常駐Docker服務.
sudo systemctl enable docker.service

2.3啟動Docker.
sudo systemctl start docker.service

Centos7三步驟就收工,當然記得安裝完後確認一下Docker的版本.
sudo docker version

如果想玩目前最新支援ipv6的1.5版,記得更新.
sudo systemctl stop docker 

sudo wget https://get.docker.com/builds/Linux/x86_64/docker-latest -O /usr/bin/docker

sudo systemctl start docker

2015年3月22日 星期日

[心得]Docker Network Configuration

建立自訂橋接網卡IP
1.停止Docker服務並移除預設 docker0上設定.
sudo systemctl stop docker
sudo ip link set dev docker0 down
sudo brctl delbr docker0
sudo iptables -t nat -F POSTROUTING
2.建立自訂橋接網卡
sudo brctl addbr bridge0
sudo ip addr add 192.168.5.1/24 dev bridge0
sudo ip link set dev bridge0 up
3.確認setp2設定
ip addr show bridge0
**使用Ubuntu當Base OS時下列指令要下:
$ echo 'DOCKER_OPTS="-b=bridge0"' >> /etc/default/docker
sudo systemctl start docker
4.最後確認
sudo iptables -t nat -L -n

Docker官網參考連結:https://docs.docker.com/articles/networking/

3/22晚安曲 楊宗緯-背叛https://www.youtube.com/watch?v=xHZ7leE_mQ8 祝大家明天上班愉快.

2015年3月10日 星期二

[心得]初嘗三大虛擬化軟體

目前常用虛擬化三大軟體不外乎Esxi 5.5,XenServer-6.5,Hyper-V Server2012 R2,而他們用戶端連線管理程式分別為:VMware vSphere Client,Citrix XenCenter,Hyper-V管理員.
這次把操作過的簡易心得提出,當然XenServer跟Hyper-V需要更多時間才能上手,所以是拿Esxi跟這兩套相比較.

心得如下:
1.Esxi不愧是虛擬伺服器上的王者,在操作使用跟安裝完後擴充上容易,缺點:網卡要求很高,一般都建議使用Intel的網卡.

2.XenServer的不方便地方在於建立虛擬伺服器時如果選擇iso安裝的話需要先建立一個公用資料夾,再分享iso檔案,接著使用內網傳輸方式安裝,這點對於用慣Esxi的人來說很痛苦阿,好處是不用刪除上傳iso檔,另外建立虛擬伺服器只有CPU,RAM能設定,日後擴充上實在很麻煩.

3.Hyper-V在管理上只能透過Hyper-V管理員,在Windows 7上都需要額外安裝,而且Hyper-V Server2012 R2這個版本只能用Windows 8來管理,採用相同OS核心才能管理,因為很重要所以要說三次,比起上述兩個來說也太麻煩了吧,好處是微軟的遠端桌面真的很好用阿.

以上,後續心得在找時間補上.