M1 Mac セットアップ情報

新しく、Applie Silicon (M1)のMacBook Airを買ったのでセットアップメモ(間違ってたら教えて下さい)

↓これは前のMacBook 12インチセットアップメモ

miettal.hatenablog.com

ちなみに総評としては、仮想化系以外は普通に動くので、とりあえずヨシッ👈ってかんじです。

Macの設定

スクリーンショットの影を消す

Ctrl+Shift+4+Spaceでウィンドウのスクリーンショットが取れるんだけど、影が周りに付いてしまうので消す。

https://book.mynavi.jp/macfan/detail_summary/id=78208

$ defaults write com.apple.screencapture disable-shadow -boolean true
$ killall SystemUIServer

Before

f:id:miettal:20210211171906p:plain

After

f:id:miettal:20210211171926p:plain

SpotlightのショートカットをCmd+SpaceからCtrl+Spaceに変更する

Ctrl+Spaceだとホームポジションからほぼ移動せずにSpotlightに行けるようになるんで、買える。

 → System Preference → Spotlight → Keyboard Shortcuts...

Sportlight → Show Spotlight search: Ctrl+Space

Input Source → Select the previous input source: Disable

キー入力スピードを早くする

qiita.com

キー押しっぱなしで、連続入力しても遅いんで、早くする。

$ defaults write -g InitialKeyRepeat -int 10
$ defaults write -g KeyRepeat -int 1

アプリ

Google Chrome

Googleが作ってるWebブラウザ。M1対応でした。M1対応版とIntel版(Rosetta必須)両方ダウンロードできるようになってた。

www.google.com

BetterSnapTool

ウインドウを壁にぶつけると、サイズが半分になって壁に張り付くやつ。AppStoreからインストール。M1対応でした。こういうOSの挙動良くする系ってM1になってどうなんだろうって思ってたけど普通に動いた。

BetterSnapTool

BetterSnapTool

  • folivora.AI GmbH
  • 仕事効率化
  • ¥370

apps.apple.com

HyperSwitch

Cmd+Tabでアプリケーションを切り替えるときに、ウインドウの中身を表示してくれるやつ。M1非対応で、Rosetta必須でした。普通に動く。

bahoom.com

Google Japanese Input

Googleが作ってる日本語IME。M1非対応で、Rosetta必須でした。普通に動く。

www.google.co.jp

Biscuit

いろんなWebアプリ、コミュニケーションをまとめて管理できるやつ。M1非対応で、Rosetta必須でした。普通に動く。

eatbiscuit.com

Dropbox

クラウドストレージ。M1非対応で、Rosetta必須でした。普通に動く。

www.dropbox.com

LINE

日本で普及しているコミュニケーションアプリ。AppStoreからインストール。M1非対応で、Rosetta必須でした。普通に動く。

apps.apple.com

開発系

iTerm2

Mac標準のTerminalより高性能な端末。M1対応でした。

iterm2.com

RictyDiminished-for-Powerline

Powerline対応のRictyフォント。まぁフォントなので普通に動く。

github.com

HomeBrew

Macのパッケージマネージャー。M1対応でした。

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Arduino

M1非対応で、Rosetta必須でした。普通に動く。

https://www.arduino.cc/en/software

仮想系

ParallelsDesktop

テクニカルプレビューだが、M1に対応してた。ArmのVMしか起動できない。ダウンロードにはParallelsのアカウントが必要。

b2b.parallels.com

Docker

テクニカルプレビューだが、M1に対応してた。x86VMも上がるらしい、ArmのVMしか試していない。

docs.docker.com

Virtualbox

M1非対応、RosettaでインストールしてGUIを立ち上げても、VMが上がらない。

www.virtualbox.org

Vagrant

対応してるかわからない。バックエンドのハイパーバイザーをどれにするかに依存する気がする。少なくともVirtualboxバックエンドでは動かなかった。

www.vagrantup.com

Vmware Fusion Player

M1非対応、RosettaでインストールしてGUIを立ち上げても、VMが上がらない。

www.vmware.com

pandasでエクセルファイルを読み込もうとすると "xlrd.biffh.XLRDError: Excel xlsx file; not supported" とエラーが表示されて、読み込めない

pd.read_excel('taisyo.xlsx')

とすると、

xlrd.biffh.XLRDError: Excel xlsx file; not supported

というエラーが出ますが、

github.com

Remove support for anything other than .xls files.

ということで、pandasがエクセルファイルを読み込むときに使っているバックエンド、xlrdが2020-12-11に2.0.0にバージョンアップし .xlsx に非対応になり、pandasでエラーとなるのでした。

openpyxl.readthedocs.io

openpyxlがxlsxに対応しているので、pd.read_excelするときのバックエンドにopenpyxlを指定しましょう。

pd.read_excel('taisyo.xlsx', engine='openpyxl')

複数のSNSから同じIDのアカウントを探してくれるsherlockが面白い

これ

github.com

こんな感じでドバーッと表示される

f:id:miettal:20191203210328p:plain

抜き出すとこんな感じになる

f:id:miettal:20191203210324p:plain

使い方

READMEの通りやる

$ git clone https://github.com/sherlock-project/sherlock.git
Cloning into 'sherlock'...
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (19/19), done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 2591 (delta 6), reused 4 (delta 1), pack-reused 2572
Receiving objects: 100% (2591/2591), 10.87 MiB | 2.43 MiB/s, done.
Resolving deltas: 100% (1631/1631), done.
$ cd sherlock/
$ python --version
Python 3.9.0a0
$ pip install -r requirements.txt
Collecting beautifulsoup4>=4.8.0
  Downloading https://files.pythonhosted.org/packages/3b/c8/a55eb6ea11cd7e5ac4bacdf92bac4693b90d3ba79268be16527555e186f0/beautifulsoup4-4.8.1-py3-none-any.whl (101kB)
     |████████████████████████████████| 102kB 1.7MB/s
Collecting bs4>=0.0.1
  Downloading https://files.pythonhosted.org/packages/10/ed/7e8b97591f6f456174139ec089c769f89a94a1a4025fe967691de971f314/bs4-0.0.1.tar.gz
Requirement already satisfied: certifi>=2019.6.16 in /Users/taisyo/.pyenv/versions/3.9-dev/lib/python3.9/site-packages (from -r requirements.txt (line 3)) (2019.6.16)
Collecting colorama>=0.4.1
  Using cached https://files.pythonhosted.org/packages/4f/a6/728666f39bfff1719fc94c481890b2106837da9318031f71a8424b662e12/colorama-0.4.1-py2.py3-none-any.whl
Requirement already satisfied: lxml>=4.4.0 in /Users/taisyo/.pyenv/versions/3.9-dev/lib/python3.9/site-packages (from -r requirements.txt (line 5)) (4.4.1)
Collecting PySocks>=1.7.0
  Downloading https://files.pythonhosted.org/packages/8d/59/b4572118e098ac8e46e399a1dd0f2d85403ce8bbaad9ec79373ed6badaf9/PySocks-1.7.1-py3-none-any.whl
Requirement already satisfied: requests>=2.22.0 in /Users/taisyo/.pyenv/versions/3.9-dev/lib/python3.9/site-packages (from -r requirements.txt (line 7)) (2.22.0)
Collecting requests-futures>=1.0.0
  Downloading https://files.pythonhosted.org/packages/47/c4/fd48d1ac5110a5457c71ac7cc4caa93da10a80b8de71112430e439bdee22/requests-futures-1.0.0.tar.gz
Collecting soupsieve>=1.9.2
  Downloading https://files.pythonhosted.org/packages/81/94/03c0f04471fc245d08d0a99f7946ac228ca98da4fa75796c507f61e688c2/soupsieve-1.9.5-py2.py3-none-any.whl
Collecting stem>=1.7.1
  Downloading https://files.pythonhosted.org/packages/7f/71/d82f4204e88be00220cc54eedb2972fd05081cb0e5ebdc537d8940b064ea/stem-1.7.1.tar.gz (2.2MB)
     |████████████████████████████████| 2.2MB 1.9MB/s
Collecting torrequest>=0.1.0
  Downloading https://files.pythonhosted.org/packages/a3/d2/00538e47a2c80979231313c346a0abc3927c7b230d69eb923bb5b221ec62/torrequest-0.1.0.tar.gz
Requirement already satisfied: idna<2.9,>=2.5 in /Users/taisyo/.pyenv/versions/3.9-dev/lib/python3.9/site-packages (from requests>=2.22.0->-r requirements.txt (line 7)) (2.8)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/taisyo/.pyenv/versions/3.9-dev/lib/python3.9/site-packages (from requests>=2.22.0->-r requirements.txt (line 7)) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/taisyo/.pyenv/versions/3.9-dev/lib/python3.9/site-packages (from requests>=2.22.0->-r requirements.txt (line 7)) (1.25.3)
Installing collected packages: soupsieve, beautifulsoup4, bs4, colorama, PySocks, requests-futures, stem, torrequest
    Running setup.py install for bs4 ... done
    Running setup.py install for requests-futures ... done
    Running setup.py install for stem ... done
    Running setup.py install for torrequest ... done
Successfully installed PySocks-1.7.1 beautifulsoup4-4.8.1 bs4-0.0.1 colorama-0.4.1 requests-futures-1.0.0 soupsieve-1.9.5 stem-1.7.1 torrequest-0.1.0

動かしてみた結果

$ python sherlock.py
[*] Checking username miettal on:
[-] ResearchGate: Illegal Username Format For This Site!
[-] 2Dimensions: Not Found!
[-] 500px: Not Found!
[-] 7Cups: Not Found!
[-] 9GAG: Not Found!
[-] About.me: Not Found!
[-] Academia.edu: Not Found!
[-] Alik.cz: Not Found!
[-] Anobii: Not Found!
[-] Aptoide: Not Found!
[-] Archive.org: Not Found!
[+] AskFM: https://ask.fm/miettal
[-] Error Connecting: Avízo.cz
[-] Avízo.cz: Error!
[-] BLIP.fm: Not Found!
[-] Badoo: Not Found!
[-] Bandcamp: Not Found!
[-] Basecamp: Not Found!
[-] Bazar.cz: Not Found!

(snip)

$ python sherlock.py | grep '+'
[+] AskFM: https://ask.fm/miettal
[+] Disqus: https://disqus.com/miettal
[+] Docker Hub: https://hub.docker.com/u/miettal/
[+] Facebook: https://www.facebook.com/miettal
[+] GitHub: https://www.github.com/miettal
[+] NameMC (Minecraft.net skins): https://namemc.com/profile/miettal
[+] TradingView: https://www.tradingview.com/u/miettal/
[+] Twitter: https://www.twitter.com/miettal
[+] YouTube: https://www.youtube.com/miettal
[+] gfycat: https://gfycat.com/@miettal

googleのロケーション履歴からヒートマップを作成してくれるgeo-heatmapが面白い

これ。 github.com

androidでかつ旅行とか出張が多い人はもっと面白い結果になるかも。 私は高専のとき千葉に住んでいて、大学院から東京に住んでいたのでそこらへんが赤くなっている。 旅行で台湾行ったりしたのも出ていて、懐かしいのも出てくる。 f:id:miettal:20191125083235p:plain f:id:miettal:20191125083222p:plain

ロケーション履歴のダウンロード

readmeの通りにやるだけ

f:id:miettal:20191125083538p:plain f:id:miettal:20191125083548p:plain f:id:miettal:20191125083557p:plain

geo-heatmap準備&実行

readmeの通りにやるだけ

$ git clone https://github.com/luka1199/geo-heatmap
Cloning into 'geo-heatmap'...
remote: Enumerating objects: 156, done.
remote: Counting objects: 100% (156/156), done.
remote: Compressing objects: 100% (124/124), done.
remote: Total 156 (delta 81), reused 75 (delta 27), pack-reused 0
Receiving objects: 100% (156/156), 4.10 MiB | 1.29 MiB/s, done.
Resolving deltas: 100% (81/81), done.

$ geo-heatmap/

$ pip install -r requirements.txt
Collecting folium
  Downloading https://files.pythonhosted.org/packages/72/ff/004bfe344150a064e558cb2aedeaa02ecbf75e60e148a55a9198f0c41765/folium-0.10.0-py2.py3-none-any.whl (91kB)
     |█ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ | 92kB 1.2MB/s
Requirement already satisfied: progressbar2 in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from -r requirements.txt (line 2)) (3.47.0)
Requirement already satisfied: requests in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from folium->-r requirements.txt (line 1)) (2.22.0)
Collecting branca>=0.3.0
  Downloading https://files.pythonhosted.org/packages/63/36/1c93318e9653f4e414a2e0c3b98fc898b4970e939afeedeee6075dd3b703/branca-0.3.1-py3-none-any.whl
Requirement already satisfied: numpy in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from folium->-r requirements.txt (line 1)) (1.17.4)
Requirement already satisfied: jinja2>=2.9 in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from folium->-r requirements.txt (line 1)) (2.10.3)
Requirement already satisfied: six in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from progressbar2->-r requirements.txt (line 2)) (1.11.0)
Requirement already satisfied: python-utils>=2.3.0 in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from progressbar2->-r requirements.txt (line 2)) (2.3.0)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from requests->folium->-r requirements.txt (line 1)) (3.0.4)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from requests->folium->-r requirements.txt (line 1)) (1.23)
Requirement already satisfied: idna<2.9,>=2.5 in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from requests->folium->-r requirements.txt (line 1)) (2.7)
Requirement already satisfied: certifi>=2017.4.17 in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from requests->folium->-r requirements.txt (line 1)) (2018.8.24)
Requirement already satisfied: MarkupSafe>=0.23 in /Users/taisyo/.pyenv/versions/3.6-dev/lib/python3.6/site-packages (from jinja2>=2.9->folium->-r requirements.txt (line 1)) (1.0)
Installing collected packages: branca, folium
Successfully installed branca-0.3.1 folium-0.10.0

$ unzip ~/Downloads/takeout-20191124T232243Z-001.zip

$ python geo_heatmap.py ~/Downloads/Takeout/ロケーション履歴/ロケーション履歴.json
Loading data from /Users/taisyo/Downloads/Takeout/ロケーション履歴/ロケーション履歴.json...
|########################################################################################################################################################################################################################################|100% Time:  0:00:00
Generating heatmap...
Saving map to heatmap.html...
Opening heatmap.html in browser...

2018年に行ったお店リスト

毎月高専の友達とうまい飯を食ってる。 その記録。

f:id:miettal:20190120183026j:plain

2月

テーマ: 肉 お店: コンコンブル 場所: 渋谷

とりあえず修論終わってうまいものを食べたかったので、食べログで肉の断面がうまそうな店を探していった。お店の雰囲気良い。うまかった。 tabelog.com

3月

テーマ: 魚 お店: 山葵(わさび) 場所: 人形町

中野のマグロマート(後述)に行きたかったのだが、予約満員で予約できなかったので、同じ魚系で探して行った。ざ、和食魚料理な感じ。うまかった。 tabelog.com

5月

テーマ: 魚 お店: マグロマート 場所: 中野

マグロのワンダーランド、すべてのメニューがマグロ。店が魚臭いが、絶品。うまかった。他のメニューも試したいので、もう一度行きたい。 tabelog.com

7月

テーマ: ベトナム お店: サイゴン・レストラン 場所: 池袋

この会から毎月いろんな国の料理を食べようということに。うまかった。 tabelog.com

8月

テーマ: タイ お店: はすの里 新御徒町本 場所: 御徒町

ベトナムとの違いがよくわからず。うまかった。 tabelog.com

9月

テーマ: トルコ お店: イズミル 場所: 阿佐ヶ谷

お店の雰囲気良い。うまかった。もう一度行きたい。 tabelog.com

10月

テーマ: モンゴル お店: シリンゴル 場所: 巣鴨

羊づくしでした。うまかった。 tabelog.com

11月

テーマ: イギリス お店: ザロイヤルスコッツマン 場所: 飯田橋

外人多い気がする。フィッシュポテト!うまかった。 tabelog.com

12月

テーマ: ロシア お店: ロゴスキー 場所: 銀座

お店の雰囲気良い。ウィスキーたくさん。うまかった。 tabelog.com

総評

うまかった。