mac
Up one levelGoogle Chrome Worker でMacの負荷が100%
昨日、Macbook airを使っていると、いつになく本体が熱くなっていました。
アクティビティモニタを見ると、cPU4コア中の1コアの負荷率がGoogle Chrome Worker というプロセスによって100%になっていました。
Google Chromeを再起動したら、Google Chrome Workerというプロセスは見えなくなって、負荷率も通常に戻っています。
- Category(s)
- mac
- The URL to Trackback this entry is:
- http://lightson.dip.jp/blog/seko/2851/tbping
http://papasan.mydns.jp/ の飛び先がマシンによって異なる
Papasanのサイト をクリックすると
Macbook Air 11inchでは http://papasan.mydns.jp/recently_modified
に行くのに
Macbook Air 13inchのFirefoxだと http://www.youtube.com/user/papasanyt
Safariだと http://papasan.mydns.jp/recently_modified
なんです。いつもは、13インチのFirefoxで見ているので、Papsanのサイトはずっと停止していると思い込んでいました。
- Category(s)
- mac
- The URL to Trackback this entry is:
- http://lightson.dip.jp/blog/seko/2819/tbping
Macbook AirにHomebrew,matplotlibをインストール失敗→成功!
Macbook Airのpythonでグラフが描きたいです。
1.Homebrewをインストールする
kazhr さんのところに書いてあることをそのまま実行
開発環境XcodeをApp storeで購入しておく
$ ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"
と実行
seko$ ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)" ==> This script will install: /usr/local/bin/brew /usr/local/Library/Formula/... /usr/local/Library/Homebrew/... ==> The following directories will be made group writable: /usr/local/. ==> The following directories will have their group set to admin: /usr/local/.Press enter to continue ==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. Password: ==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/. ==> Downloading and Installing Homebrew... ==> Installation successful! Now type: brew help
アップデート
seko$ brew update Initialized empty Git repository in /usr/local/.git/ remote: Counting objects: 53169, done. remote: Compressing objects: 100% (24377/24377), done. remote: Total 53169 (delta 34111), reused 44744 (delta 28086) Receiving objects: 100% (53169/53169), 7.69 MiB | 1.10 MiB/s, done. Resolving deltas: 100% (34111/34111), done. From https://github.com/mxcl/homebrew [new branch] gh-pages -> origin/gh-pages [new branch] master -> origin/master HEAD is now at f78eb1c wireshark: add 1.7.0 as the devel version Already up-to-date.
2. PILをインストール
こちら に書いてある通りに実行。
seko$ sudo easy_install pip seko$ sudo ARCHFLAGS="-arch i386 -arch x86_64" pip install PIL
3.ScipySuperpackをインストール
https://github.com/fonnesbeck/ScipySuperpack
にいって、下の方にあるDownload Scipy Superpack Installer for OSX 10.7 を保存。
ちなみに2012年1月31日の依存性は
Dependencies OS X 10.7 (Lion), Python 2.7, Xcode 4.2
ダウンロードしたディレクトリで
$ sh install_superpack.sh
と実行するとNumpy (2.0) and Scipy (0.11), Matplotlib (1.2), iPython (0.12), Pandas (0.6)がまとめてインストールされるらしい。
$ sh install_superpack.sh
Are you installing from a repository cloned to this machine (if unsure, answer no)? (y/n)
y
Downloading gFortran ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11.3M 100 11.3M 0 0 352k 0 0:00:32 0:00:32 --:--:-- 127k
Installing gFortran ...
Password:
installer: Package name is GNU Fortran 4.2.4 for Lion Xcode 4.1 (build 5666.3)
installer: Installing at base path /
installer: The install was successful.
Installing Scipy Superpack ...
error: Not a URL, existing file, or requirement spec: ./*.egg
Installing readline ...
Searching for readline
Reading http://pypi.python.org/simple/readline/
Reading http://www.python.org/
Reading http://github.com/ludwigschwardt/python-readline
Best match: readline 6.2.1
Downloading http://pypi.python.org/packages/2.7/r/readline/readline-6.2.1-py2.7-macosx-10.7-intel.egg#md5=8aef7cc656e1bdfe851a8e6f91c63c4c
Processing readline-6.2.1-py2.7-macosx-10.7-intel.egg
creating /Library/Python/2.7/site-packages/readline-6.2.1-py2.7-macosx-10.7-intel.egg
Extracting readline-6.2.1-py2.7-macosx-10.7-intel.egg to /Library/Python/2.7/site-packages
Adding readline 6.2.1 to easy-install.pth file
Installed /Library/Python/2.7/site-packages/readline-6.2.1-py2.7-macosx-10.7-intel.egg
Installing nose ...
Searching for nose
Reading http://pypi.python.org/simple/nose/
Reading http://somethingaboutorange.com/mrl/projects/nose/
Reading http://readthedocs.org/docs/nose/
Best match: nose 1.1.2
Downloading http://pypi.python.org/packages/source/n/nose/nose-1.1.2.tar.gz#md5=144f237b615e23f21f6a50b2183aa817
Processing nose-1.1.2.tar.gz
Running nose-1.1.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-3XrNEO/nose-1.1.2/egg-dist-tmp-uR71QE
Adding nose 1.1.2 to easy-install.pth file
Installing nosetests script to /usr/local/bin
Installing nosetests-2.7 script to /usr/local/bin
Installed /Library/Python/2.7/site-packages/nose-1.1.2-py2.7.egg
Installing DateUtils
Searching for DateUtils
Reading http://pypi.python.org/simple/DateUtils/
Best match: DateUtils 0.5.1
Downloading http://pypi.python.org/packages/source/D/DateUtils/DateUtils-0.5.1.tar.gz#md5=40cff15a40664eeb117361049edbd0bd
Processing DateUtils-0.5.1.tar.gz
Running DateUtils-0.5.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-QrU1Rh/DateUtils-0.5.1/egg-dist-tmp-a7rRdp
zip_safe flag not set; analyzing archive contents...
Adding DateUtils 0.5.1 to easy-install.pth file
Installed /Library/Python/2.7/site-packages/DateUtils-0.5.1-py2.7.egg
Done
pythonでインポートしてみると。。。だめです。
$ python Python 2.7.1 (r271:86832, Jun 25 2011, 05:09:01) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib Traceback (most recent call last): File "", line 1, in ImportError: No module named matplotlib
調べてみるとマシンのXcodeのバージョンは4.1です。要求されているバージョンは4.2なので、App Storeを見に行くと4.2がダウンロード済みになっていて、更新することができません。検索してみると、同じ現象 を見つけました。 「アプリケーション」フォルダーに保存されていたの"Install Xcode" を実行して無事4.2になりました。 この後、再びScipySuperpackを実行したら、matplotlibが使えるようになりました。
- The URL to Trackback this entry is:
- http://lightson.dip.jp/blog/seko/2807/tbping
Macbook airにrst2pdfインストール 失敗
開発環境のX codeを入れればいいのかな?
Last login: Sun Jan 1 21:55:24 on console seiinishiekuchi-haku-no-MacBook-Air:~ seko$ sudo easy_install rst2pdfWARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password: Searching for rst2pdf Reading http://pypi.python.org/simple/rst2pdf/ Reading http://rst2pdf.googlecode.com Reading http://code.google.com/p/rst2pdf/downloads/list Best match: rst2pdf 0.16 Downloading http://rst2pdf.googlecode.com/files/rst2pdf-0.16.tar.gz Processing rst2pdf-0.16.tar.gz Running rst2pdf-0.16/setup.py -q bdist_egg --dist-dir /tmp/easy_install-BL1bhd/rst2pdf-0.16/egg-dist-tmp-aVQigh zip_safe flag not set; analyzing archive contents... rst2pdf.createpdf: module references __file__ rst2pdf.image: module references __file__ rst2pdf.pdfbuilder: module references __file__ rst2pdf.styles: module references __file__ rst2pdf.tests.autotest: module references __file__ rst2pdf.tests.execmgr: module references __file__ Adding rst2pdf 0.16 to easy-install.pth file Installing rst2pdf script to /usr/local/bin
Installed /Library/Python/2.7/site-packages/rst2pdf-0.16-py2.7.egg Processing dependencies for rst2pdf Searching for Pygments Reading http://pypi.python.org/simple/Pygments/ Reading http://pygments.org/ Reading http://pygments.pocoo.org/ Best match: Pygments 1.4 Downloading http://pypi.python.org/packages/2.7/P/Pygments/Pygments-1.4-py2.7.egg#md5=acbdde4dae30efaba8cfa86dcb6070f2 Processing Pygments-1.4-py2.7.egg creating /Library/Python/2.7/site-packages/Pygments-1.4-py2.7.egg Extracting Pygments-1.4-py2.7.egg to /Library/Python/2.7/site-packages Adding Pygments 1.4 to easy-install.pth file Installing pygmentize script to /usr/local/bin
Installed /Library/Python/2.7/site-packages/Pygments-1.4-py2.7.egg Searching for reportlab>=2.1 Reading http://pypi.python.org/simple/reportlab/ Reading http://www.reportlab.com/ Best match: reportlab 2.5 Downloading http://pypi.python.org/packages/source/r/reportlab/reportlab-2.5.tar.gz#md5=cdf8b87a6cf1501de1b0a8d341a217d3 Processing reportlab-2.5.tar.gz Running reportlab-2.5/setup.py -q bdist_egg --dist-dir /tmp/easy_install-qhYqVC/reportlab-2.5/egg-dist-tmp-1kvi8h ################################################ #Attempting install of _rl_accel, sgmlop & pyHnj #extensions from
/private/tmp/easy_install-qhYqVC/reportlab-2.5/src/rl_addons/rl_accel################################################ ################################################ #Attempting install of _renderPM #extensions from/private/tmp/easy_install-qhYqVC/reportlab-2.5/src/rl_addons/renderPM# installing without freetype no ttf, sorry! # You need to install a static library version of the freetype2 software # If you need truetype support in renderPM # You may need to edit setup.cfg (win32) # or edit this file to access the library if it is installed ################################################ Downloading standard T1 font curves Finished download of standard T1 font curves unable to execute llvm-gcc-4.2: No such file or directory error: Setup script exited with error: commandllvm-gcc-4.2failed with exit status 1 seiinishiekuchi-haku-no-MacBook-Air:~ seko$
なんとかインストールしても実行するとエラーになります。
$ rst2pdf sample.rst Traceback (most recent call last): File "/usr/local/bin/rst2pdf", line 8, inload_entry_point( rst2pdf==0.16,console_scripts,rst2pdf)() File "/Library/Python/2.7/site-packages/rst2pdf-0.16-py2.7.egg/rst2pdf/createpdf.py", line 1452, in main numbered_links=options.numbered_links, File "/Library/Python/2.7/site-packages/rst2pdf-0.16-py2.7.egg/rst2pdf/createpdf.py", line 169, in __init__ get_language (self.language) TypeError: get_language() takes exactly 2 arguments (1 given) seiinishiekuchi-no-MacBook-Air:Desktop seko$
こちら を参考に、エラーメッセージを見てパスを探して__init__.pyを書き換えます。
$ sudo vim /Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/languages/__init__.py
def get_language(language_code, reporter): ↓ def get_language(language_code, reporter=None):
- The URL to Trackback this entry is:
- http://lightson.dip.jp/blog/seko/2796/tbping
Macbook AirのFTPクライアント
Windowsマシンがあまりにも遅いので、最近は Macbook Air を使っています。
WindowsのFTPクライアントならFFFTPあたりが定番ですが、Macでは何がいいのか分かりません。
今回は、Firefoxのアドインである FireFTP を使ってみました。 21ポート以外も設定できるので、Ploneの8021ポートにも無事接続できました。 ファイルを入れたり、取り出したりするだけなら、これで問題なさそうです。
- The URL to Trackback this entry is:
- http://lightson.dip.jp/blog/seko/2689/tbping
ソースコードの行頭に空白を入れる方法
このブログは、structuredTextを使って書いています。ソースコードを貼付けるときは、段落づけが必要で、すべての行の頭に空白を入れる必要があります。
今までは手で入れていたのですが、長いソースだと大変です。そういう時は、preタグを入れていたのですが、よく見るとダブルコーテーションなどが正しく表示されていません。
最近は、Macbook Airを使っており、エディタは mi です。 mi のヘルプを見たら、検索オプションで設定をすると 正規表現での置換 が行えることが分かりました。
行頭^を見つけて、スペースに置換すればOKです。手でやってた人なんていなかったんですね。
ちなみにこの文書は初めて reStructuredText で書いてみました。
- The URL to Trackback this entry is:
- http://lightson.dip.jp/blog/seko/2685/tbping
Re:ソースコードの行頭に空白を入れる方法
もう一人、ここに居ます。
Re:ソースコードの行頭に空白を入れる方法
向上心を持ちませう。
miエディタでpythonを使えるように
インストール対象:Macbook air 2011 13inch lion
mi用pythonモードをMacOSXで使う方法 をみながらやってみる。
pythonはOSの付属のものを使うことにする。
こちら からmiをダウンロードする
こちら から「mi用pythonモード」をダウンロード.
ダブルクリックするとPython_mode_f.img というのができる。
それをダブルクリックすると「レガシーイメージを変換する必要があります」というメッセージがでる。
ユーティリティの中にあるディスクユーティリティを起動して、ファイルを変換する。 拡張子はdmgになる。
変換したファイルをダブルクリックしてマウントする。
ファイル名が文字化けしていないか確認するが、問題なし
miを起動する.
「メニューバー>mi>モード設定>モード追加>新規モード(インポート)...」>モードファイルからインポートで「Python_mode_f/Python/Python」を選択.
ファイル>新規作成>pythonを選ぶとpythonモードになっている
- The URL to Trackback this entry is:
- http://lightson.dip.jp/blog/seko/2612/tbping
Macbook airにpython開発環境を作りたいがよくわからない
Macbook air (2011年夏モデルlion 13inch core i5 4G 256G)でpythonを使えるようにしたいと思い、いろいろ調べてみましたが、よくわかりませんでした。
標準で入っているpythonに変に手を加えてしまうと、OS自体の動作もおかしくしてしまうかもしれないのが不安です。
- OSに標準で入っているPython2.7を使う
- python.orgからダウンロードしてインストール
- macportsでインストールし、pythonselectで切り替える
- pythonbrew+virtualenv
- homebrewを使ってインストール
- python + eclipse
- 仮想マシンにlinuxを入れてそちらのpythonを使う
- The URL to Trackback this entry is:
- http://lightson.dip.jp/blog/seko/2584/tbping
MacBook Air 11inch 買った
妹の誕生日祝いに買ってやると約束していたのですが、使ってみるとすごくいいので、自分のものにします。 何がいいって、スタンバイ状態から一秒で使えるようになるところです。 今までのパソコンは何だったのかという感じです。
妹には、Apple Storeから直送するように今しがた手配しました。
さっそく、このトラブルに遭遇です。 スタンバイからの復帰の際に、絨毯の模様なものが現れたり消えたしました。 電源ボタン長押しで、再起動させると問題なく使えます。
http://journal.mycom.co.jp/news/2010/11/06/016/index.html
- The URL to Trackback this entry is:
- http://lightson.dip.jp/blog/seko/2348/tbping
以前、FullCalendarへの書き込みが頻繁にありましたのでpool.e-mobile.ne.jpからのアクセスをリダイレクトしていたことがありました。
多分、キャッシュがどこかに残っているのでしょう?、キャッシュをクリアーしてみてくだされ。
名前解決もキャッシュされるものなのですね。
Papasanは重病に違いないとマカロニさんに話していたのは内緒です。