OS X + Vagrant 1.8.7 で vagrant up できない時の対応 #El Capitan

Vagrant 1.8.7 の curl が壊れているようで vagrant up すると box の取得に失敗します。

$ VAGRANT_LOG=DEBUG vagrant up
...
DEBUG subprocess: stderr: dyld: Library not loaded: @rpath/libcurl.4.dylib
...

Issues にあるワークアラウンドで解決します。

$ sudo mv /opt/vagrant/embedded/bin/curl /opt/vagrant/embedded/bin/curl.orig
$ sudo ln -nsf /usr/bin/curl /opt/vagrant/embedded/bin/curl

Curl broken in macOS vagrant 1.8.7 · Issue #7997 · mitchellh/vagrant · GitHub

OS X の OpenSSL をバージョンアップ #El Capitan

OS X の OpenSSL はバージョンが古いので、Homebrew の OpenSSL を使うようにします。

$ openssl version
OpenSSL 0.9.8zh 14 Jan 2016

OpenSSL インストール

$ brew install openssl

Homebrew な OpenSSL を使うための設定

以前は brew link コマンドで、Homebrew の OpenSSL を使うようにしましたが、OpenSSL のリンクはできなくなったようです。

$ brew link openssl --force
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
  -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

なので、PATH を通すようにします。

$ echo 'export PATH=/usr/local/opt/openssl/bin:$PATH' >> ~/.bash_profile
$ . ~/.bash_profile
$ which openssl
/usr/local/opt/openssl/bin/openssl
$ openssl version
OpenSSL 1.0.2j  26 Sep 2016

落穂ひろい

Homebrew な OpenSSL のヘッダファイルを使ってコンパイルする時は、以下のオプションで明示的に指定する必要があるようです。

-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib

(インストール時のメッセージ)

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

Golang はじめました

だいぶ出遅れましたが、ようやく Golang の勉強をはじめました。
備忘録的に書いていきたいと思います。

Golang とは?

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

The Go Programming Language

以下のような特徴があります。

Golang のインストール

OS X に homebrew でインストールしました。

$ brew install go
$ go version
go version go1.6.2 darwin/amd64

環境変数 GOPATH*1 を設定します。

$ mkdir -p $HOME/go
$ echo 'export GOPATH="$HOME/go"' >> $HOME/.bash_profile
$ . $HOME/.bash_profile

Golang で Hello, World

コード(hello.go)

package main

import (
    "fmt"
)

func main() {
    fmt.Println("Hello, World!")
}

実行

$ go run hello.go 
Hello, World!

コンパイル

作成した hello.go をコンパイルして、実行ファイルを作成します。

$ go build -o hello hello.go
$ ./hello 
Hello, World!

これから

Golang のスタートラインに立つことができました。(たぶん)
Golang でインフラ管理系ツールとか書きたい。


The Go Programming Language

*1:ワークスペース、外部パッケージ、外部ライブラリ用ディレクトリパス

Windows 10 インストール時のエラー(エラーコード: 0x80070570) #windows10

自作した PC に Windows 10 Pro(64bit) インストールする時に、発生したエラー。

必要なファイルをインストールできません。ファイルが破損しているか見つ
からない可能性があります。インストールに必要なすべてのファイルが利用
可能であることを確認し、インストールを再実行して下さい。エラーコード: 0x80070570

怪しいインストールメディア使っていないなら、メモリが原因の可能性が高いと思います。
メモリ複数枚挿している場合は枚数減らしてみたり、他にWindows 環境があるならメモリ診断実行してみるのがいいと思います。

私の場合は、メモリの初期不良(相性かも?)だったので、交換してもらいました。

Oculus Ready な PC を自作した

まだ Oculus 届いてませんが、Oculus Ready な PC を自作しました。
久しぶりの自作だったので、いろいろ変わっていて驚きました。

Recommended Specification

公式サイトで公開されているスペックは、以下の感じです。

  • Video Card : NVIDIA GTX 970 / AMD R9 290 equivalent or greater
  • CPU : Intel i5-4590 equivalent or greater
  • Memory : 8GB+ RAM
  • Video Output : Compatible HDMI 1.3 video output
  • USB Ports : 3x USB 3.0 ports plus 1x USB 2.0 port
  • OS : Windows 7 SP1 64 bit or newer

Oculus Ready PCs | Oculus

Spec

自作 PC のスペックです。

www.oculus.com