カテゴリー : Mac

Seashore が macOS Sierra で起動しなくなった

Seashore が macOS Sierra で起動しなくなりました…。

検索してみると、動かないと報告している記事がいくつか見つかったので Seashore 開発元がメンテナンスを再開しない限り、もう使えないのでしょうね。

続きを読む

ビデオ通話中に通知を OFF にできる Mac アプリ「Muzzle」が超便利

Mac でビデオ通話中に通知を OFF にできるアプリ Muzzle がめっちゃ便利なのでご紹介します。

続きを読む

[macOS Sierra] 毎回 Enter passphrase for key を表示させない解決方法

macOS Sierra へアップグレードしてから、毎回 Enter passphrase for key ‘/Users/yourname/.ssh/id_rsa’: を表示させない設定方法をご紹介します。

続きを読む

[Mac] Terminal でコマンドが完了したら通知してくれる terminal-notifier が便利!

Mac で Terminal にて、コマンドが完了したら通知してくれる terminal-notifier が便利なのでご紹介します。

続きを読む

Mac で Windows を無料で利用する方法 (IE, Edge のみ)

Mac で Windows を無料で利用する方法をご紹介します。

前提として、Internet Explorer や Microsoft Edge ブラウザの動作確認以外の用途で使うとライセンス違反になるので、それ以外のソフトウェアをインストールしてはいけません。

VirtualBox のインストール

まず、無料の仮想化ソフト VirtualBox をインストールします。

ievms でインストールする

次に Terminal から ievms を利用して IE をインストール

全バージョンをインストール

IE, Edge の全てのバージョンをインストールするには下記のコマンドを実行するだけで完了です。

curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | bash

特定のバージョンのみをインストール

例えば IE11 と EDGE だけをインストールしたい場合は、以下のようなコマンドを実行します。

curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | env IEVMS_VERSIONS="11 EDGE" bash

Windows の初期ログインパスワード

ログインパスワードは Password1 (Pは大文字)です。

まとめ ievms に感謝

ievms のおかげで Mac だけで IE のブラウザチェックが完結できるのは有り難いです。

参考情報

iftop を Mac にインストール

iftop を Mac にインストールする手順をご紹介します。

$ brew install iftop

なぜか brew install しただけでは iftop コマンドへの path が通ってないので、/usr/local/bin/ 以下にシンボリックリンクを作成します。

$ ln -s /usr/local/Cellar/iftop/1.0pre4/sbin/iftop /usr/local/bin/iftop
$ which iftop
/usr/local/bin/iftop
$ iftop -h
iftop: display bandwidth usage on an interface by host
 
Synopsis: iftop -h | [-npblNBP] [-i interface] [-f filter code]
                               [-F net/mask] [-G net6/mask6]
 
   -h                  display this message
   -n                  don't do hostname lookups
   -N                  don't convert port numbers to services
   -p                  run in promiscuous mode (show traffic between other
                       hosts on the same network segment)
   -b                  don't display a bar graph of traffic
   -B                  Display bandwidth in bytes
   -i interface        listen on named interface
   -f filter code      use filter code to select packets to count
                       (default: none, but only IP packets are counted)
   -F net/mask         show traffic flows in/out of IPv4 network
   -G net6/mask6       show traffic flows in/out of IPv6 network
   -l                  display and count link-local IPv6 traffic (default: off)
   -P                  show ports as well as hosts
   -m limit            sets the upper limit for the bandwidth scale
   -c config file      specifies an alternative configuration file
   -t                  use text interface without ncurses
 
   Sorting orders:
   -o 2s                Sort by first column (2s traffic average)
   -o 10s               Sort by second column (10s traffic average) [default]
   -o 40s               Sort by third column (40s traffic average)
   -o source            Sort by source address
   -o destination       Sort by destination address
 
   The following options are only available in combination with -t
   -s num              print one single text output afer num seconds, then quit
   -L num              number of lines to print
 
iftop, version 1.0pre4
copyright (c) 2002 Paul Warren <[email protected]> and contributors

以上です。

[Mac] brew update で Error: /usr/local must be writable! 対応

brew update で Error: /usr/local must be writable! がでたときの対応方法です。

$ brew update
Error: /usr/local must be writable!

調べるとまず brew doctor してみてと書いてあったので、やってみます。

$ brew doctor
 
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
 
Warning: /usr/local is not writable.
 
You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami) /usr/local
 
Warning: /usr/local is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. For example, upgrading
to OS X El Capitan has been known to do this. Some versions of the
"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations
are known to do this as well.
 
You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami) /usr/local
 
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
  brew install oniguruma
 
Run `brew missing` for more details.
 
Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.

sudo chown -R $(whoami) /usr/local しろと書かれているので、実行して brew update を再実行してみます。

sudo chown -R $(whoami) /usr/local

次は update.sh: line 13: /usr/local/Library/ENV/scm/git: No such file or directory ってエラーが発生しました。

brew update
 
/usr/local/Library/Homebrew/cmd/update.sh: line 13: /usr/local/Library/ENV/scm/git: No such file or directory
()
/usr/local/Library/Homebrew/cmd/update.sh: line 13: /usr/local/Library/ENV/scm/git: No such file or directory
Error: update-report should not be called directly!
brew prune

たまに brew update すると苦労しますね・・・。

参考情報

[Mac] Excel (エクセル) が遅いときの解決方法

仕事でバイヤーさんの業務改善をしていて「最近、Excel の文字入力が遅くて困ってる」という相談を受けて、解決方法を調べて実践したのでその手順をご紹介します。

Mac Office2011 Excel

事前準備 – Excel アプリを終了する

まず最初にすべきことは「Excel を終了する」ことです。

これを忘れていると、環境設定ファイルやキャッシュファイルを削除しても Excel が遅い問題は解決されません。

僕は実際に Excel を終了する手順を忘れてしまっていて「Excel 遅いの治らない…」という状況に陥りました。

フォントファイルの重複修正

  1. アプリケーションから Font Book アプリを開く
  2. All Fonts で全てのフォントを選択する
    Font Book - All Fonts
  3. Font の重複を解消する
    Font Book - Look for Enabled Duplicates

環境設定 plist ファイルの削除

  1. Finder から Shift + ⌘ + G を押してダイアログボックスに ~/Library/Preferences/ を入力する
    Finder - ~/Library/Preferences/
  2. 以下の環境設定ファイルを削除する
    com.microsoft.Excel.plist
    • com.microsoft.Excel.plist
    • com.microsoft.office.plist

キャッシュの削除

  1. Finder から Shift + ⌘ + G を押してダイアログボックスに ~/Library/Caches/ を入力する
    Finder - ~/Library/Caches/
  2. Microsoft フォルダを削除する
    Caches - Microsoft

まとめ

Excel for Mac の動作が重いときに解決する手順は以上です。

環境設定ファイルやキャッシュファイルを削除しないと遅くてまともに使えないなんて Excel ダメすぎだろー。

Mac OS X El Capitan にアップグレードしたら hub コマンドが動かなくなったけど brew upgrade hub したら解決した

Mac OS X El Capitan がリリースされてそれなりに時を経たので、会社で使ってる Mac も El Capitan へアップグレードしました。

タイトルで終わってますが El Capitan にアップグレードしたら hub コマンドが動かなくなったのですが brew upgrade hub したら解決したので、似たようなエラーに悩まされた方は brew upgrade するといいですよ。

hub コマンドのエラー事例

いつも通り hub コマンドで github の pull-request を作成しようと思ったら、見たことのないエラーが発生しました。

$ hub pull-request -h myGitHubRepo:`git symbolic-ref --short HEAD`
/usr/local/bin/hub:75:in `initialize': wrong number of arguments (9 for 1) (ArgumentError)
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1030:in `new'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1030:in `proxy_uri'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1017:in `proxy?'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:868:in `connect'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:851:in `start'
	from /usr/local/bin/hub:473:in `perform_request'
	from /usr/local/bin/hub:588:in `perform_request'
	from /usr/local/bin/hub:437:in `post'
	from /usr/local/bin/hub:371:in `create_pullrequest'
	from /usr/local/bin/hub:1760:in `pull_request'
	from /usr/local/bin/hub:1586:in `run'
	from /usr/local/bin/hub:2514:in `initialize'
	from /usr/local/bin/hub:2518:in `new'
	from /usr/local/bin/hub:2518:in `execute'
	from /usr/local/bin/hub:2569:in `<main>'

ネットで調べてみたところ 「hub のバージョンが古いと動かないので brew upgrade hub するといいよ」という内容を書いている isuue を見つけたのでそれ通り対応してみたら解決しました。

$ brew list | grep hub
hub
 
$ hub --version
git version 2.1.3
hub version 1.12.2
 
$ brew upgrade hub
==> Upgrading 1 outdated package, with result:
hub 2.2.3
==> Upgrading hub
==> Downloading https://homebrew.bintray.com/bottles/hub-2.2.3.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring hub-2.2.3.el_capitan.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
 
zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/hub/2.2.3: 9 files, 10.3M

OS アップグレードは何かしらハマりますね。

brew update で fatal: cannot create directory at ‘.github’: Permission denied というエラーが出たときの対応方法

Mac で brew update を実行したら、

$ brew update
fatal: cannot create directory at '.github': Permission denied
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

というエラーメッセージが表示されたときの対応方法をご紹介します。

/usr/local ディレクトリの permission を変更

fatal: cannot create directory at ‘.github’: Permission denied というエラーメッセージが表示されるのは /usr/local ディレクトリの permission が無いのが原因です。

chown コマンドで所有者を自分に変更しましょう。

$ ls -la /usr/local
total 112
drwxr-xr-x   24 root     wheel    816 Oct 28 08:47 .
$ sudo chown $(whoami):admin /usr/local
$ ls -la /usr/local
total 112
drwxr-xr-x   24 myname  admin    816 Oct 28 08:47 .

Homebrew の GitHub repository を master へ更新

cd `brew --prefix`
git fetch origin
git reset --hard origin/master

最後に Homebrew をアップデート

$ brew update
$ brew -v
Homebrew 0.9.9 (git revision 145155; last commit 2016-04-23)
Homebrew/homebrew-core (git revision bd06; last commit 2016-04-23)

以上です。