標籤

ASP.NET MVC (29) Visual C# (15) JQuery (10) Plugins (8) JQuery Plugins (6) JavaScript (6) MySQL (5) CSS (4) LinQ (4) Mac OS (4) CentOS (3) Design Pattern (3) Entity Framework (3) IIS (3) Python (3) Windows (3) php (3) Docker (2) LAMP (2) SQL Server (2) WCF (2) .NET (1) .NET Core (1) AWS (1) Browser (1) GIS (1) IE (1) Internet Security (1) Linux (1) Platform (1) React (1) SEO (1) Testing (1) VMware (1) Windows 7 (1) cookie (1) curl (1) laravel (1) phpBB (1) session (1) 中古屋 (1) 透天 (1) 閒言閒語 (1) 面試 (1) 鳥松 (1)
顯示具有 Mac OS 標籤的文章。 顯示所有文章
顯示具有 Mac OS 標籤的文章。 顯示所有文章

2016年7月10日 星期日

[MySQL] Mac 啟動 MySQL 出現「ERROR! MySQL server PID file could not be found! ERROR! The server quit without updating PID file」


今天啟動MySQL服務時出現警告:


ERROR! MySQL server PID file could not be found!
ERROR! The server quit without updating PID file (/usr/local/mysql/data/XXX.pid).

回想一下因為更新brew更動到/usr/local/的目錄權限, 使用chown將目錄權限改回即可運作:


sudo chown _mysql /usr/local/var/mysql/*





Reference:



2016年6月21日 星期二

Mac OS 安裝 .NET Core 與執行 HelloWorld

.NET Core 不需要Mono也可以在MacOS & Linux中執行, 趁著空擋來玩看看, 以下是所有安裝及執行的過程:

1. 更新brew

➜  ~ brew update


2. 透過brew安裝openssl

➜  ~ brew install openssl


3. link openssl

➜  ~ brew link --force openssl


4. 移除之前的版本, 執行sh檔案內容請參考
(https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/uninstall/dotnet-uninstall-pkgs.sh), 這邊我選擇使用vim新增一個sh檔案並把內容複製到檔案內.

➜  ~ vim dotnet-uninstall-pkgs.sh


5.賦予可執行權限

➜  ~ chmod +x dotnet-uninstall-pkgs.sh 


6. 執行
➜  ~ sudo sh dotnet-uninstall-pkgs.sh

Deleting install root - /usr/local/share/dotnet
rm: /usr/local/share/dotnet: No such file or directory
rm: /etc/paths.d/dotnet: No such file or directory

dotnet packages removal succeeded.


7. 下載pkg檔案並且安裝
https://go.microsoft.com/fwlink/?LinkID=798400







8. 建立Helloword專案
➜  mkdir hwapp
➜  cd hwapp

➜  hwapp dotnet new



9. 恢復project.json

➜  hwapp dotnet restore



10. 編譯並執行

➜  hwapp dotnet run




真的有輸出「Hello World」!, 既然如此順便看看編譯後的專案結構與專案原始碼


看起來與原本Windows一樣有bin & obj 資料夾, 原始碼看起來也是與原本.NET環境下相同, 順便看看bin資料夾下有什麼東東...


真的有hwapp.dll檔案~

雖然覺得微軟進入的比較晚, 但也算是重大突破了!



Reference:
https://www.microsoft.com/net/core#macosx


2015年5月21日 星期四

在Mac OS 安裝Docker


Linux & MacOS 不同的是
Linux 預設已經有執行 Docker daemon & Docker Host
MacOS 則是執行在Boot2Docker提供的Linux virtual machine上








1. 安裝Virtual Box
https://www.virtualbox.org/

2. 安裝docker
➜  ~  brew install docker


3. 安裝boot2docker
➜  ~  brew install boot2docker


4. 初始化boot2docker
➜  ~  boot2docker -v init


5. 啟動boot2docker
➜  ~  boot2docker up

*記得要在command執行三段export指令或是寫入bash中

6. 使用docker info指令
➜  ~  docker info


7. 使用[docker run -d -P --name web nginx]命令執行nginx image, 第一次執行因為沒有image所以直接下載

8. 使用[docker ps]命令看目前正在執行的image:

9. 使用[docker port web]命令查詢目前web的listen port是多少, 下圖為32769:

10. 由於Mac是透過boot2docker, 使用[boot2docker ip]命令查詢boot2docker VM的IP位址.


瀏覽 [http://192.168.59.103:32769/] 即可看到nginx的預設頁面









Reference:

Install Docker on Mac OS X

How to Use Docker on OS X: The Missing Guide




2014年7月3日 星期四

Mac 常用快速鍵

Option + Command + Esc = 關閉程序
Shift + Command + 3 = Snap
Shift + Command + 4 = Snap Area


- Finder
Command + Shift + A =  Application
Command + Shift + U = Utility
Command + Shift + G = Go


-Sublime
Command + Shift + P = Package
Ctrl + ~ = command line


thanks to Gary, Alan