2015年8月26日 星期三

VirtualBox 5.0.2安裝Mac OS X 10.10 (Yosemite)

新增虛擬主機,並依照圖片中的設定即可正常安裝 1. 版本請選擇 Mac OS X 10.10 Yosemite (64-bit) ![Alt text](http://2.bp.blogspot.com/-IFv5KIalKjY/VduOvZvaRiI/AAAAAAAANpA/lscdHttxjfw/s640/Image%2B1.png) 2. 晶片組 ICH9 指標裝置 USB平板 延伸功能 全選 ![Alt text](http://3.bp.blogspot.com/-lNtA-JXYPKQ/VduOvcot1RI/AAAAAAAANo8/PonTd9hojPk/s1600/Image%2B2.png) 3 啟用 VT-x/AMD-V 啟用Nested Paging ![Alt text](http://4.bp.blogspot.com/-9CAsm5bzvYw/VduOvVbhPCI/AAAAAAAANpE/4dkerBnLzDA/s1600/Image%2B3.png) 4 視訊記憶體調到128M 啟用3D加速 ![Alt text](http://2.bp.blogspot.com/-OYp_OxCRrlk/VduOwFWyOcI/AAAAAAAANpM/Nqaopv8XsQI/s1600/Image%2B4.png) 5 掛載Yosemite原版ISO ![Alt text](http://1.bp.blogspot.com/-QO6Z9N4tm90/VduOwdk1nNI/AAAAAAAANpU/XDj3TvYlI00/s1600/Image%2B5.png) 6. 執行以下指令 ```bash VBoxManage setextradata "虛擬機器名稱" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3" VBoxManage setextradata "虛擬機器名稱" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "虛擬機器名稱" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" VBoxManage setextradata "虛擬機器名稱" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "虛擬機器名稱" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 VBoxManage setextradata "虛擬機器名稱" "VBoxInternal2/EfiGopMode" 4 ``` 這樣就能在Virtualbox 5.0.2上正常安裝Yosemite

2015年8月14日 星期五

Laravel 5 取得 Artisan::call的執行結果

```php // 輸出結果 class WelcomeController extends controller { public function index() { return response()->stream(function() { Artisan::call('inspire'); echo Artisan::output(); }); } } ```

2015年8月9日 星期日

Laravel 5 資料庫timezone設定

原本在設定database的timezone的設定方式是採取 ```php 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'options' => [ PDO::MYSQL_ATTR_INIT_COMMAND => 'SET time_zone = "+08:00"' ], ], ``` 後來卻在laravel的原始碼發現 ![Alt text](http://4.bp.blogspot.com/-SLJP_9qgldc/VcdSMcyO8XI/AAAAAAAANoA/8Roi9nPXVfg/s1600/Image%2B6.png) 所以timezone的設定只要這樣寫就可以 ```php 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'database' => env('DB_DATABASE', 'forge'), 'username' => env('DB_USERNAME', 'forge'), 'password' => env('DB_PASSWORD', ''), 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'strict' => false, 'timezone' => '+08:00', ], ```

2015年8月2日 星期日

找出Windows的序號

重灌或升級windows時有時候會忘記序號 又找不到序號時就很煩好 還好找到一個免費又簡單的找出序號的軟體 ### [Lazesoft Windows Key Finder](http://www.lazesoft.com/lazesoft-windows-key-finder.html) 而且它是Open Source Freeware的軟體 不用擔心會有病毒喔 支援的作業系統 * Windows 2000 SP4 * Windows XP * Windows Vista * Windows 7 * Windows 8 * Windows 8.1 * Windows Server 2003 * Windows Server 2008 * Windows Server 2008 R2 * Windows Server 2012 * Windows Server 2012 R2 支援的OFFICE * Microsoft Office 2000 * Microsoft Office 2003 * Microsoft Office 2007 * Microsoft Office 2010 * Microsoft Office 2013 ![Alt text](http://4.bp.blogspot.com/-JuTNGAZ6EKs/Vb4sYZnDWnI/AAAAAAAANnk/tg2-pPAZENM/s1600/lazesoft-windows-key-finder.jpg)