$ ruby -v
ruby 2.0.0p451 .....
$ node -v
v0.10.25
require 'openssl'
require 'digest'
require 'base64'
def encode(cryptkey, iv, cleardata)
cipher = OpenSSL::Cipher.new('AES-256-CBC')
cipher.encrypt
cipher.key = cryptkey
cipher.iv = iv
encrypted = ''
encrypted << cipher.update(cleardata)
encrypted << cipher.final
Base64.strict_encode64(encrypted)
end
data = 'The quick brown fox jumps over the lazy dog'
cryptkey = Digest::SHA256.digest('012345678901234567')
iv = '0a1b2c3d4e5f6g7h'
x = encode(cryptkey, iv, data)
=> "SWozLQpQiz2itvbl1PomOPBTvxMmIE6rl4gZlerajsnJrhAfvp6jj5MBSlu+8fle"
var crypto = require('crypto');
b64dec = function(data) {
buf = new Buffer(data, 'base64');
return buf.toString('binary')
};
decode = function(encrypted_64, cryptkey, iv) {
var cryptkey = crypto.createHash('sha256').update(cryptkey).digest(),
decipher = crypto.createDecipheriv('aes-256-cbc', cryptkey, iv),
decoded = decipher.update(b64dec(encrypted_64));
return Buffer.concat([decoded, decipher.final()]);
}
decode('SWozLQpQiz2itvbl1PomOPBTvxMmIE6rl4gZlerajsnJrhAfvp6jj5MBSlu+8fle',
'012345678901234567','0a1b2c3d4e5f6g7h').toString()
'The quick brown fox jumps over the lazy dog'
]]>
5秒おきに、現在値がざっ、ざっ、と動くような感じ。向いてる方向もせわしなく動く。Google Map アプリのナビや Waze なんか使おうもんなら、移動してないのに向きがせわしなく切り替わったり、あっちいったりこっちいったり、斜め後ろ向いたままザザッと動き続けたり。
これは使えん。GPS アンテナか GPS ユニットが壊れたんかなぁ、と。
ところが、原因切り分けのために、ふと思い立って Wi-Fi を off にすると、急にまともに使えるように。Wi-Fi を on に戻すと、また不正確な位置と向きをせわしなく表示。ふーむ。
通常は GPS から取得した位置情報と Wi-Fi から取得した位置情報、そしてモバイルデータ通信から取得した位置情報をうまく使ってくれるはずなのですが、Wi-Fi を on にしていると、GPS と Wi-Fi の位置情報を使わずにモバイルデータ通信からの位置情報のみを使ってくれているように見える。どうもソフトウェア的な何かの不具合に思えます。
というわけで、PC にバックアップを手動でとったのち、いちど工場出荷状態に戻し、バックアップから復元し直しました。4000曲くらいが iTunes から同期されていているのですが、全て(ハイレゾや 16/44 から)192kbps AAC に変換されて同期されるので、復元にはもの凄く時間がかかります。寝る前に復元開始し、朝起きたら終わってました。あいぽんの空き容量も9GBくらいから14GBくらいに増えてる。いろんなアプリや iOS の吐くゴミデータで埋まってたのかな。
で、今朝幼稚園へ送る際に確認してみたところ、直ってました。
もし復元でも直らなかったら、ジーニアスバーに持ち込んで新品に交換してもらおうと企んでいたのですが、それはなくなりました。ともあれまた意図した通りに動作してくれて一安心。。。
追記 (2013/11/06):
直ってませんでした(涙)。というか状況の切り分けが間違ってました。
正確にはこうでした。「カーオーディオにUSB接続すると、あいぽんのGPSがアホになる」。よって、自家用車による走行中のみ GPS がおかしかったことになります。手持ちで徒歩の時などは全く問題ないことを確認しました。普段歩きながらマップを見たりしないので、気付かなかった(状況切り分けを間違えた)という感じです。。。
ちなみに車中のホルダーに装着していても、Lightning to USBケーブルによる接続を外せば、再び位置情報がまともになります。つまり、車中のために GPS 電波が拾いにくくなって不正確になっているのではない、ということです。
エンジンを完全に off にすると、位置情報は正確に戻ります。そしてキーをひねって acc や on の位置にする(カーオーディオに通電する)と、とたんに位置情報が乱れ出します。今日はそこまで確認。
問題は、数週間前まで、こんなことはなかった、ということ。ここから先の原因特定は少し難儀です。
もうちょっと状況証拠を集めてみようと思います。
追記 (2013/11/07):
iPhone5s を借りてカーオーディオに接続してみたところ、(私の iPhone5 がかつてそうだったように)特に問題なく現在位置を捕捉していることを確認。ということで、
のケースに該当していそう。Genius Bar で交換してもらえる程度なのかは微妙な気が。。。
追記 (2013/11/09):
なんと直ってしまった(笑)。壁打ちテニス中にあいぽんをポケットから落としたせいらしい。多分、基板からGPSセンサーが外れかけていて?接触不良で?、落とした衝撃でちゃんと繋がったのではないかと推察。。。Genius Bar 予約はとりあえずキャンセルすることに。
BackBlaze や Bitcasa などと比較検討し、以下の点で採用を決定しました。
自宅のルータ兼サーバ(Vine Linux で稼働中)上で動かせ、ローカルネットワーク上にあって NFS マウントして使っている NAS(NETGEAR ReadyNAS)上のコンテンツをバックアップできる、という点で選定しました。デーモンも管理UIも Java で動くというスタイルのようです。
]]>まずは30日間のお試しから。先月中旬から開始して、いまだに写真(410GB オーバー)のバックアップが完了せず。。。(現在366GB完了、残り47GB)
そしてお試し期間があと2日で終了となってしまいましたが、総合的にこれは使える判断し、サブクスリプション申込することにしました。1台のPCからの無制限バックアップのプラン(CrashPlan+ Unlimited)で、1月単位だと $5.99、1年単位だと月当たり $5.00、4年単位だと月当たり $3.96。今回は1年単位で申込しました。
やれやれ、これで安心だ、と思っていたら、なんだかサーバの動作が不穏に。40秒から1分おきに負荷が急激に上がったり下がったり。
どうやら CrashPlan のデーモン(java で動作しています)が突然死を繰り返しているみたい。ログにも特に何も有用な情報は残ってなさげ。
恐らくメモリ回りではないかなぁ、と思って調べたら、やっぱりそうでした。
As a rule of thumb set about one gigabyte (=1024 MB) RAM for every terabyte in the file selection.
ということで、/usr/local/crashplan/bin/run.conf
(この path は気持ち悪いですね。。。なんで bin 以下に設定ファイルが。。。)内の設定を -Xmx512m
から -Xmx1024m
に変更。これでデーモンの無限再起動が収まりました。
が、NAS 上の動画や iTunes Music なども CrashPlan のバックアップ対象に追加したとたんに、またメモリー不足になることは目にみえていますが。。。はたしてどうなることやら。
]]>なんもせずにフツーに認識されてフツーに使えた。ややつまんないけど。
ドライバはそのまんま pl2303
。
Bus 005 Device 002: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x067b Prolific Technology, Inc.
idProduct 0x2303 PL2303 Serial Port
bcdDevice 3.00
iManufacturer 1 Prolific Technology Inc.
iProduct 2 USB-Serial Controller
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x000a 1x 10 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)
]]>
そのため Time Machine によるバックアップも、(仮想化ソフトウェアでゲストOSを全く使用していない時を除き)毎回数GB〜数10GB単位で行われることになり、あっという間にバックアップ領域がいっぱいになってしまいます。
そこで、仮想マシン用のディスクイメージが保存されているディレクトリ、VirtualBox の場合は「~/VirtualBox VMs
」を、Time Machine のバックアップ除外リストに指定し、これらディスクイメージを別途バックアップする、いう使い方をされている方も少なくないでしょう。
あるいは、ゲストOS上で直接、古式ゆかしき dump
、あるいは rsync
や pdumpfs
などを使って、バックアップを取るという方法を取られている方もいるでしょう。
OS X (Leopard) 以降では、スパースバンドルディスクイメージ (Sparse Bundle Disk Image) がサポートされています。これは、従来の単一ファイルのディスクイメージではなく、OS X Finder 上でディスクイメージのように見えているものはバンドル(ディレクトリ)で、その中には 8MB ごとに分割されたフラグメントが収められています。このディスクイメージをマウントし、その中にファイルを追加したり削除したり変更を加えたりすると、8MB 単位で分割されたフラグメント単位で増えたり減ったり修正が加わったりするわけです。
なので、このスパースバンドルディスク上に、仮想マシン用のディスクイメージを保存しておけば、Time Machine によるバックアップでも効率よくバックアップできる、ということになります。とはいっても、ゲストOSを起動するだけで、結構な差分量が生じるようですが。。。それでも通常の Time Machine バックアップよりはましになるのでよしとしましょう。
現在 OS X 上で VirtualBox を使っているとして、仮想マシンのディスクイメージをスパースバンドルディスクに移行するおおまかな手順は以下の通りです。
~/VirtualBox VMs/
の中のフォルダをすべてコピーする
~/VirtualBox VMs
をリネームするなり、削除する
と、まあ、いまのところは、こんな感じで使っています。Time Machine であれ、rsync であれ、これで毎回のバックアップで無駄に差分が生じることはなくなるはずです。
この MacBook Air でも、じきに OS X の VirtualBox 上で Vine を常用する形態から、直接 Vine を起動して常用することになっていくとは思いますが、とりあえずいまはこんな感じで。。。
]]>故 Jobs 氏への強い思い入れは不思議とほとんどなかったのかな、 と改めて思いました。 むしろ Bill Atkinson さん、故 Jeff Raskin さん、 Andy Hertzfeld さん、Joanna Hoffman さん、といった、 エンジニアな方々への興味の方が強かったのかな、と。
]]>大学生協で買ったこれが自分で所有した最初。はじめて触ったのは 1988年頃の Plus だったかな。1983年、当時定期購読していた科学雑誌ウータンに Lisa の特集記事が載っていたのも懐かしい。不思議と Apple II との接点はあまりありませんでした。
最終的には外付 SCSI 100MB HDD をつけたり、メモリを 4MB に増設したりしながら、漢字Talk 6.0.7〜GomTalk〜漢字Talk7.0.1までなんとか使ったんやったかな。
当時好んで使っていたキーボードは今でも大事に持っていますが、ADB接続なので使えません。。。
本体と一緒に買ったドットインパクトプリンタ。これでよく印刷してプログラミングのレポートとか提出した記憶がある。しかも Pascal のソースコードを Los Angeles フォントで印刷とかアホなことをしていた記憶が。のちに白黒の HP DeskWriter を買うまでは大変お世話になりました。
バイトしまくって買った。4MBメモリ、80MB HDD くらいだった記憶。縦長のブラウン管ディスプレイと一緒に。縦に広いとこんなにも楽なんだというのを実感した最初。そのバイト先では IIcx や PowerBook 140 などもあって、頻繁に使った記憶。
またまたバイトしまくって買った。スペックは覚えてないけど、のちに PowerPC Upgrade Card を挿して延命した。この私物を当時いた大学の研究室に持ち込み、10Base-2 経由でインターネットに接続していた。今であれば、一瞬でセキュリティ担当がすっ飛んできてこっぴどく叱られるであろう、のどかな時代。
最初の就職先で使用。後半は web サーバとして使用されていた記憶。のちに Vine Linux for PowerMac 開発マシンとなる。
唯一買った互換機。アメリカから並行輸入。PowerMac 4400 と同等のマザーボードだったと思いますが、ADB 以外に PS/2 コネクタも装備していたのが互換機っぽかった記憶。
職場で使用。あまり記憶にない。
職場で使用。のちにこれが最初の Vine Linux for PowerMac 開発マシンとなる。
自宅で使用。
職場で使用。同室の助手の方が置いていったもの。これも最後は Vine マシンになった。
自宅で妻が使用。たしか Apple Store でリファービッシュ品(整備済製品)として買ったんだったかな。ストロベリー色の iMac。これものちに Vine 開発機として大活躍しました。このマシン自体を持って行き、Linux のイベントで発表したこともありました(iMac をプロジェクタにつないで発表。。。)
転職した直後に秋葉館で購入した記憶。OS X 10.1 はインストールはされたもののほとんど使われることもなく、Vine マシンとして 2008年まで酷使し続けました。
OldWorld Mac が家からなくなっていたので、秋葉原で中古を購入、Vine のテスト機として机の下で待機していました。
某所の某氏より無償で貸していただいていたもの。長らく Vine サブ開発マシンとして活躍してくれました。鏡餅が懐かしい。
耳をつんざかんばかりの轟音と共に、Vine 開発マシンとしてつい先日まで活躍してくれました。OS X は見事に一切使われませんでした。
スキャナマシンとして使っていた G4 AGP が故障した際、某氏が提供してくれたマシン。ありがとうございました。
PowerBook G4 Titanium がぶっ壊れたのでやむなく購入。やはりほとんど Vine 開発マシンとして日々使われました。
某氏からタダで譲って頂いたもの(ありがとうございます)。基本的に Vine のテスト用。既に iMac G3 だの iMac G4 だのは家になく、OS 9 が動く古いマシンで Linux テストするためにあると便利なので。。。
私にとっては、CD ウォークマン以来、初めての携帯ディジタル音楽プレーヤー、という点が一番大きかったかも。なにせ音楽メインソースはいまだにレコードでしたから。。。家の音楽CDのリッピングはいまだに終わっていません。。。まだあと数百枚。。。
現在も VirtualBox 上で Vine を使うのがメイン。
MacBook White (Early 2008) は現在妻がメインマシンとして使用中。
G4 MDD がついに壊れたので中古で購入。いまさら Vine/ppc64 を開発。。。することは今のところなく、普通に iTunes 母艦&スキャナマシンとして使われています。
Bought a MacBook Air (Middle 2011) - 11inch, US Keyboard, 4GB Memory, 128GB SSD and Core i7 - to replace my MacBook (Early 2008) that has served me very hard as a Vine Linux development environment as a daily basis for a few years.
To be honest, I always have used my whity MacBook with Vine - Mac OS X is always there on the harddrive in a separated partition, but I seldom booted it up on my MacBook - maybe once or twice a year? Another OSX machine at home, an old PowerMac G4 MDD, is still there and serving me as a daily basis as well, to store my huge digital music contents (almost all in lossless format) on iTunes (still hundreds of CDs left to get ripped though), and as a scanning machine (connected to the old SCSI A3 flatbed scanner).
The first thing I did on my new toy was to play around the new OS for a while that amazed me a bit. This was the first time for me to play with the multi-touch trackpad and gestures. I felt Gestures and "Mission Control" are really great for portable computers with small screens like this MBA 11inch.
And the next thing I gonna do was, of course, to figure out how well this brand new machine is supported on Linux - I know there are so much to get done on the Linux kernel, the X thing, and some userland utilities, to run Linux on the MBA 2011 flawlessly, but I just thought it was worth checking out and playing around.
So you are going to try installing Vine Linux on your MacBook Air (Middle 2011) which doesn't come with any recovery media. Of course, if you have a wireless connection to the Internet, you will be able to restore OS X Lion through the net, without any install media. This is called “Internet Recovery”, built into newer Macs starting with Mac Mini (Middle 2011) and MacBook Air (Middle 2011).
But you should be fully prepared - “Providing is preventing” - you would be happier to have the physical recovery medium, an USB flash drive, that contains OS X Lion Recovery, before facing some accidental issues.
All you need is an USB flash drive and Lion Recovery Disk Assistant. Create the USB flash drive recovery media before installing Linux for safety.
In case you already build up your own environment on OS X Lion, you would better back up your whole system with Time Machine - this will simplify the process of restoring your entire OS X environment onto the specific partition of your harddrive.
Now you are nearly ready. Prepare another USB flash drive and make the USB install medium. If you already have Linux machines, connect the flash drive to the machine, identify the device name (such as /dev/sdb
) very carefully, then just do this:
$ sudo dd if=Vine60-x86_64-DVD.iso of=/dev/sdb
(or alternatively)
$ sudo sh -c 'cat Vine60-x86_64-DVD.iso > /dev/sdb'
Similarly you can create the USB install medium on Windows machines, using DDforWindows or Image Writer for Windows.
CAUTION, PLEASE NOTE: Unfortunately a nasty bug is found on Vine Linux 6.0 x86_64 edition, that will cause some issues, when trying to install onto the harddrives with GPT partition table. The bug is already fixed (among the Vine developers) and will be released as a part of future releases of Vine Linux. 32bit edition does not suffer from this issue. You would install the 32bit edition instead, or wait for the minor fix version of the x86_64 edition.
Shut down your MacBook Air, plug the USB flash drive, hold the option
key while pressing the power button, then you will see the boot selector named “Startup Manager” that is built in Intel Macs. Select the USB flash drive and press return, and the initial screen of Vine Linux Installer would appear.
Be sure to select NOFB MODE before proceeding - otherwise your MBA will black out and will “hard freeze”. The KMS (Kernel-based Mode Setting), Intel Framebuffer driver and Xorg driver on Vine Linux 6.0 (even on breeding-edge Linux kernel and Xorg as of today) is NOT compatible with the 2011 MBA hardware yet.
Then the Vine Installer starts. As my MBA is brand new and I already have Recovery USB flash drive, so I don't hesitate to erase all the partition on the MBA SSD. If you already have your own OSX Lion environment, you would back up your whole OSX system with Time Machine as noted far above.
The only thing you should keep in mind is, place the Linux partitions first, then the OS X partition. This is a limitation of the GRUB bootloader (unless you use newer GRUB2 bootloader), as it only sees the MBR partition tables which can hold up to four partitions. OS X on Intel Macs, on the other hand, relies on the GPT (GUID Partition Table) that can hold more partitions. As long as you use the GRUB bootloader, Linux partitions (especially the /
partition or /boot
partition which holds Linux kernels and initrds) must be either of first four partition.
My case - I know MBA 2011 is not fully supported on Linux yet (and hopefully several months needed to get fully supported), so I decided the Vine Linux directly on MBA 2011 was just for testing purpose. 10GB for /
, 2GB for swap
, the rest (approximately 107GB) kept free to reinstall OS X later.
Did a few settings (selecting languages, keyboards, timezone and a few more) in the Vine Installer, then finally the installation process starts. As the MBA comes with a SSD harddrive, package installation itself is faster than you could imagine - just a few minutes - not long enough to grind coffee beans and drip brew. You would try instant coffee when installing Linux on machines with SSD.
Okay, you finished installing Vine Linux. But you need a few more to do. Otherwise the Linux system you just installed won't boot.
Next, you need to reinstall OS X. Boot from the Restore USB flash drive, open Disk Utility, and create the HFS+ partition while keeping the Linux partitions intact. Then proceed restoring OS X. Alternatively you may restore your OS X system from the Time Machine backup onto the HFS+ partition you just created.
You are just one step away from the completion. Boot up the OS X you just reinstalled/resotred, grab rEFIt, then install.
Then open the Terminal, and type the following command.
$ cd /efi/refit
$ sudo ./enable.sh
Okay, now you are almost done. Reboot your MBA. If you did everything correctly, you will see the rEFIt boot selector.
But don't rush - you have one more thing left to do - syncronize GPT and MBR tables. On the rEFIt screen, use arrow key to select “Partitioning Tool” (gptsync
) then press return. Press Y to syncronize the GPT/MBR partition tables. Then shut down your MBA once for safety.
Then you'll be able to boot into the Vine Linux, finally.
Unfortunately, as I already noted far above, there are still so many things to get done on the Linux kernel, the X thing, and some userland utilities, to run Linux on the MBA 2011 flawlessly. You will see many restrictions on Linux (not only Vine but also many other distros) on MBA 2011, at least AS OF AUG. 16, 2011.
Vine Linux 6.0 doesn't fully support MBA 2011, while VineSeed (development version of Vine Linux) gradually supports MBA 2011 features - see the updates below.
(1) (Vine Linux 6) You'll need to add nomodeset
to the grub.conf. Otherwise your MBA will hard-freeze during bootup.
UPDATE: (SEP. 6, 2011):
most recent VineSeed (kernel-3.0.4-1vl7) doesn't hard-freeze w/o nomodeset
. However, you need Apple Mini DisplayPort (ThunderBolt) / DVI (or HDMI) Adapter to get the screen. Without nomodeset
, the screen will only appears on the external display (built-in LCD will get blank).
UPDATE: (SEP. 16, 2011):
most recent VineSeed (kernel-3.0.4-2vl7) finally supports 1366x768 resolution on the built-in LCD. Now no need to add nomodeset
to the grub.conf.
(2) (Vine Linux 6) X still can't do 1366x768. 1024x768 at most, strangely stretched wide.
UPDATE: (SEP. 6, 2011):
with recent kernel and without nomodeset
described above,
you get normal 1024x768 on the external display. Intel HD Graphics can do
3D accelaration (w/ xorg-x11-drv-intel-2.16.0-2vl7) and compatible with
GNOME Shell.
UPDATE: (SEP. 16, 2011):
with recent kernel (3.0.4-2vl7) and without nomodeset
described above, you finally get 1366x768 on the built-in LCD display,
featuring 3D acceleration with GNOME Shell.
(3) Wireless network works out of the box - with kernel-module-compat-wireless
package installed (on Vine6), or with kernel-3.0.1 (VineSeed).
(4) Sound output is initially muted, so you need the following tasks:
alsamixer
.F6
key, and unmute the “Surround” or the likes. Press ESC
to exit.sudo alsactl store
to save the setting.
(5) FaceTime Camera is properly recognized by Linux kernel with uvcvideo
.
(6) Special keys, such as LCD backlight control (F1/F2), keyboard backlight control (F5/F6), sound mute/volume control (F10/F11/F12) does not work at all. The pommed
will treat them like a charm on old MacBooks and MacBook Pros (or even some PowerBooks and iBooks), but unfortunately the pommed is not compatible with the new MacBook Air (Mid 2011) yet.
(7) As this is a Mac, there is no middle-click and right-click - you'll need to enable mouse button emulation to handle this. There are two ways to accomplish the mouse button emulation - one is sysctl way and and the other is Xmodmap way. Please search over the Internet as there are plenty of pages on this.
(8) UPDATE: (SEP. 16, 2011): at least with most recent kernel (3.0.4-2vl7) on VineSeed, suspend/resume works flawlessly on my MBA Mid2011 11-inch.
So the status of Vine Linux 6.0 on MBA 2011 for desktop purpose is still far from flawless (although there's a notable progress going on with the development version, VineSeed, as described above). But I have my old MacBook 2008 that runs VineSeed rock solid, and I have spent my daily computer life on this. I bought my MBA to replace my old MacBook.
That's why I decided to create rather small Linux partitions (10GB for /
) on the SSD, keeping the OS X partition approximately 90% of its original size. I mean, sometimes (or very frequently) I may want to try if Linux (as of today) runs good on MBA, but too early to spend every minute on this.
So what did I do?
We have another (and very easy) way to install Linux on Intel Macs - VirtualBox (not VertualBox, but VirtualBox - to whom it may concern). I mean, I install Vine Linux on a VirtualBox running on OS X Lion. I know there is yet another way - a similar solution - VMWare Fusion, a famous commercial product. But this time I go with VirtualBox as I've been already familiar with running VirtualBox on Vine Linux - testing Vine installer, using other Linux distributions for certain purposes, et al.
The installation itself is really a piece of cake. And you'll get the Linux running on a virtual machine like a charm. You don't have to worry about hardware compatibility issues. You can quickly let your Mac sleep by closing the lid, while Linux is on a virtual machine - no matter what that Linux is compatible with sleep or not. You can run Linux on full-screen mode (although VirtualBox is not OS X Lion's ‘Full-Screen’ App yet) with 1366x768 resolution very quick and fast. You can instantly switch from OS X (host OS) and Vine Linux (guest OS) by swiping the trackpad with your three fingers - give another huge round of applause to Mission Control!
This is “insanely great”, actually. Two Vine Linux developers (daisuke & munepi) bought MBA 2011 as well, and they do this way. They didn't ever tried to install Vine directly onto their MBAs like I did this time.
But in the meantime I will keep looking for some hacks and upstream fixes that will make Vine Linux running directly on newer Intel Macs flawlessly like it already does on my old whity MacBook. This is why I still keep small 10GB Linux partition on my MBA 2011's SSD.
Okay, so I need to move my current Vine environment on my MacBook to the VirtualBox on OS X Lion - hope it will not take long - and I gotta say to myself, installing Linux on MacBook Air is just the means of restoring my daily environment, not an end in itself (except when I am debugging and developing Vine Linux itself).
]]>
panic occurred, switching back to text console
BUG: scheduling while atomic: swapper/0/0x10010000
Modules linked in: sit tunnel4 rfcomm sco bnep l2cap vboxnetadp vboxnetflt vboxdrv autofs4 sunrpc
ipv6 acpi_cpufreq freq_table mperf dm_mirror dm_region_hash dm_log dm_mod uinput snd_hda_codec_realtek
snd_hda_intel lib80211_crypt_tkip snd_hda_codec wl(P) snd_hwdep uvcvideo btusb snd_seq_dummy
snd_seq_oss snd_seq_midi_event snd_seq videodev bluetooth ohci1394 v4l1_compat snd_seq_device
applesmc snd_pcm_oss snd_pcm hwmon rfkill lib80211 ieee1394 led_class snd_timer snd firewire_ohci
soundcore firewire_core i2c_i801 snd_page_alloc sky2 input_polldev mbp_nvidia_bl pcspkr crc_itu_t
joydev iTCO_wdt iTCO_vendor_support appletouch processor battery thermal ac ata_generic pata_acpi
uhci_hcd ohci_hcd ehci_hcd i915 dkms_kms_helper drm i2c_algo_bit button i2c_core video output
[last unloaded: cpufreq_ondemand]
Pid: 0, comm: swapper Tainted: P D 2.6.35-20vl6 #1
Call Trace:
[<c102d3a6>] __schedule_bug+0x1/0x56
[<c1359495>] schedule+0x83/0x4b9
[<f7d7b78e>] ? drm_crtc_helper_set_config+0x84/0x65b [drm_kms_helper]
[<c135999d>] _cond_resched+0x2e/0x47
[<c10c8b80>] __kmalloc+0xa8/0x145
[<f7d7b78e>] drm_crtc_helper_set_config+0x94/0x65b [drm_kms_helper]
[<c1005e37>] ?show_trace_log_lvl+0x39/0x43
[<f7d7aae8>] drm_fb_helper_force_kernel_mode+0x2b/0x5b [drm_kms_helper]
[<f7d7ab62>] drm_fb_helper_panic+0x17/0x1d [drm_kms_helper]
[<c104b6c3>] notifier_call_chain+0x14/0x16
[<c1359289>] atomic_notifier_call_chain+0x14/0x16
[<c1359289>] panic+0x73/0xbc
[<c1005c17>] oops_end+0x7a/0x88
[<c102088f>] no_context+0x115/0x11f
[<c102098a>] __bad_area_nosemaphore+0xf1/0xf9
[<c1020af0>] ? do_page_fault+0x0/0x2eb
[<c10209a4>] bad_area_nosemaphore+0x12/0x15
[<c1020c32>] d0_page_fault+0x142/0x2eb
[<c10080fd>] ?sched_clock+0x9/0xd
[<c104bfb3>] ?sched_clock_local+0x17/0x11e
[<c1020af0>] ?do_page_fault_0x0/0x2eb
[<c135b9b6>] error_code+0x66/0x6c
[<c104007b>] ? ignore_signals+0x21/0x27
[<c1020af0>] ?do_page_fault+0x0/0x2eb
[<f91a3e0d>] ?rtMpNotificationLinuxOnCurrentCPU+0xa/0x9d [vboxdrv]
[<f91a3a51>] rtmpLinuxWrapper+0x22/0x27 [vboxdrv]
[<c10572e7>] generic_smp_call_function_single_interrupt+0xa0/0xba
[<c1017e29>] smp_call_function_single_interrupt+0xa0/0xba
[<c135b546>] call_function_single_interuupt+0x2a/0x30
[<c104007b>] ? ignore_signals+0x21/0x27
[<f86fa1ea>] ? acpi_idle_enter_bm+0x24d/0x289 [processor]
[<c12b7475>] cpuidle_idle_call+0x73/0xce
[<c10023a3>] cpu_idle+0x4e/0x67
[<c1357280>] start_secondary+0x1a8/0x1ad
I'd been looking for the solution to the issue, and finally I found this was it:
The fix itself was very trivial:
--- src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c (revision 73209)
+++ src/VBox/Runtime/r0drv/linux/mpnotification-r0drv-linux.c (revision 73210)
@@ -77,7 +77,7 @@
* @param pvUser2 The notification event.
* @remarks This can be invoked in interrupt context.
*/
-static void rtMpNotificationLinuxOnCurrentCpu(RTCPUID idCpu, void *pvUser1, void *pvUser2)
+static DECLCALLBACK(void) rtMpNotificationLinuxOnCurrentCpu(RTCPUID idCpu, void *pvUser1, void *pvUser2)
{
unsigned long ulNativeEvent = *(unsigned long *)pvUser2;
NOREF(pvUser1);
Now the fix has been included on VirtualBox-4.1.0-2vl7 (VineSeed).
Same fix for Vine Linux 6 (more precisely, packages for VinePlus/6) will be uploaded as 4.1.0-2vl6 as well shortly.
]]>以下、やったことのまとめ。
USB に書き込んだ DVD インストーライメージ (x86_64) から起動、普通にインストール。特に問題もなく終了。
コンソールは vesa モードで起動、普通に plymouth によるスプラッシュが出てきました。X も16bitで上下左右が幾分欠けてはいるものの、とりあえず動作しています。オンボードの無線ネットワーク (Atheros AR9285) も特になにもせずに使えました。やや拍子抜け。
以下、lspci
の出力。
00:00.0 Host bridge: nVidia Corporation MCP79 Host Bridge (rev b1)
00:00.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)
00:03.0 ISA bridge: nVidia Corporation MCP79 LPC Bridge (rev b3)
00:03.1 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)
00:03.2 SMBus: nVidia Corporation MCP79 SMBus (rev b1)
00:03.3 RAM memory: nVidia Corporation MCP79 Memory Controller (rev b1)
00:03.5 Co-processor: nVidia Corporation MCP79 Co-processor (rev b1)
00:04.0 USB Controller: nVidia Corporation MCP79 OHCI USB 1.1 Controller (rev b1)
00:04.1 USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1)
00:06.0 USB Controller: nVidia Corporation MCP79 OHCI USB 1.1 Controller (rev b1)
00:06.1 USB Controller: nVidia Corporation MCP79 EHCI USB 2.0 Controller (rev b1)
00:08.0 Audio device: nVidia Corporation MCP79 High Definition Audio (rev b1)
00:09.0 PCI bridge: nVidia Corporation MCP79 PCI Bridge (rev b1)
00:0a.0 Ethernet controller: nVidia Corporation MCP79 Ethernet (rev b1)
00:0b.0 IDE interface: nVidia Corporation MCP79 SATA Controller (rev b1)
00:0c.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:10.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:15.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:16.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:17.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
00:18.0 PCI bridge: nVidia Corporation MCP79 PCI Express Bridge (rev b1)
03:00.0 VGA compatible controller: nVidia Corporation C79 [ION] (rev b1)
04:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
このままでもまあまあ使えますが、今回はメインが動画閲覧目的ですので、まずはプロプライエタリな nvidia
ドライバをインストール。
$ sudo apt-get update
$ sudo apt-get install xorg-x11-drv-nvidia
あとは以下の手順で、とりあえず nvidia ドライバで X が使えるようになります。
$ sudo nvidia-xconfig (雛形的な xorg.conf が作られる)
$ sudo nvidia-config-display enable (必要な module path が追加される)
$ sudo reboot
具体的には、Files
セクションに、以下の ModulePath
が追加され、
Section "Files"
ModulePath "/usr/lib64/xorg/modules/extensions/nvidia"
ModulePath "/usr/lib64/xorg/modules"
FontPath "/usr/share/fonts/default/Type1"
EndSection
Device
セクションでドライバに nvidia
を指定するだけのようです。
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
その他、DefaultDepth
や Deph
も明示的に 24
になっています。
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
今回は、うちにあるテレビ (TOSHIBA REGZA 32R1) に HDMI 接続していますが、そのままだと上下左右が欠けてしまうので、OverscanCompensation
の値を調整して、適切な表示になるようにします。設定は nvidia-settings
から。この画面では、OverscanCompensation=60
に指定しています。
毎回 X が起動する際にこの値を有効にするため、
nvidia-settings -a "OverscanCompensation=60"
というコマンドを、どこかに書いておくことに。
今回は、リビングで使うメディアサーバ的で、gdm
で自動ログインするような使い方を念頭においてますので、/etc/X11/gdm/PreSession/Default
に書いておくことに。もっと別の場所に書く方がスマートかもしれません。
今回はテレビと HDMI 接続するので、オーディオ出力も HDMI にします。が、デフォルトのままではオーディオが出力されていないようです。
いろいろ調べると、HDMI 経由のディジタル出力が alsa 的にミュートされているらしいことが分かりました。なので、alsamixer
でミュートを解除してみます。この画面では、一番右の S/PDIF
、S/PDIF D
、S/PDIF 1
あたりが該当します。
これで、次回起動時にもこの設定が有効になるように、以下のコマンドを実行して、/etc/asound.state
に書きだしておきます。
$ sudo alsactl store
もうこれで、普通に使う分には問題ない状態になってしまいました。拍子抜け。もっといろいろクセのあるハードであれこれいじりたかったところですが、まあそれだけ当たりのマザーを引いたということで、よしとしておきます。
あとやったのは、今回必要となるあたりのソフトウェアをインストールしたり、
$ sudo apt-get install task-all-codecs self-build-vlc \
self-build-xbmc chromium
gdm2setup
などを使って自動ログインを有効にし、テレビからある程度離れて操作することを考えて、GNOME デスクトップのフォントや Chromium のフォントを大きめに設定することくらいです。
これで、仕事部屋に置いてある NAS サーバ上に NFS なり SMB なりを経由して、動画ファイルや DVD からリッピングした ISO ファイル、それと写真などを xbmc
で閲覧できる環境が整いました。
CULV Celeron SU2300 (1.2GHz Dual Core) + ION という構成ですが、まあ普通に 1080i や 720p な動画を見る分には充分な感じです。また、妻が使っている DELL のノートPCの調子が最近特に悪く(使っていると勝手に電源が落ちたりする)、その当座のバックアップ環境ということで、web 閲覧環境がリビングに用意できたという面もあるかもしれません。
あとは、うーんと、手元には USB なり Bluetooth なワイヤレスキーボードがないので、適当によさそうな奴を探すことくらいでしょうか。なんかオススメのものってありますかね。
]]>We just watched the class behind the fence - not the trial lesson for my daughter. Sorry for her - she complained that she wanted to join the class and play with balls and racquets. Very sorry for her. Anyway we watched 80% of the whole lesson - about 40 minutes - until my daughter got bored of standing behind the fence, watching the kids class on the tennis court.
Not bad. We saw two children (two four-years-old boys) in the class on that day, while on the neighbouring court “Players' Course” (a very serious class for teens who wants to be professional tennis players) was playing very hard. The two kids were having fun at the class, moving and playing with much joy. They didn't look like they got bored.
]]> To be honest, it was really a great introduction for 4-6 years old children, for parents who seriously wants their kids play tennis very hard in the near future.But I don't think it was great for my daughter. Here's just a simple point why.
Stretching, running, holding balls on a racket (and moving around), hitting balls forehands and badkhands moving quick, etc... Okay. it's a nice “introduction” to tennis for kids, but my daughter still don't know how fun it is to play tennis seriously (she already likes to watch professional tennis matches on TV with me and she already loves to play with sponge balls and her kid racquet, though). I am just afraid if she would hate tennis before she got interested in tennis seriously.
I just thought it was not the right time for her. The class would work very good for her, after she would get interested in tennis very seriously. But in the meantime it's just that I want to look for any good kids class where my daughter can play with other kids and getting to know how the sport is like, getting interested in the sport, and getting to like the sport itself.
My conclusion is, that it is just too early for my three-years-old daughter to do a complete subset of what grown-up school students are doing IMHO. Maybe a few years later when she really gets to know tennis is fun. Or should I look for any other tennis schools for kids where they can feel and learn such “everything even before the ABC's”?
So what any good sport for my daughter? We've already observed some Kids Classical Ballet lessons that really amazed her so much. She always says “I like pretty things. Ballet is pretty. Tennis is cool, but not pretty!” Hahaha... Anyway maybe someday I do hope I play tennis with you...
]]>To tell the truth I have been always wondering, why the progress bar on the boot-up screen looks like this. The progress bar is placed on the black background - the border is drawn in white colour - so the which is the progress bar itself, black one, or white one?
Seems like the “script” theme itself adopts black-coloured bar as a progress bar itself. So the following screenshot means that the boot-up process is now about 20% complete:
But don't you think it a bit strange? Sometimes do you see this as “the progress bar coming from the right side, now approximately 80% complete” or something?
I believe, in this example (black background, progress bar with white border), the following screenshot should represents “approximately 20% complete” far better:
If the latter one is still ambiguous, how about the following example whose border colour and the progress bar colour is bit different? I like this much better IMHO.
What would you think? Am I the only one who think it different?
P.S.
This change can be easily done by editing the following png files:
/usr/share/plymouth/themes/script/progress_bar.png
/usr/share/plymouth/themes/script/progress_box.png
And don't forget to execute “sudo /sbin/new-kernel-pkg --mkinitrd --depmod --install (kernel_version)
” (kernel_version
= 2.6.35-18vl6
for example) to take effect.
P.S. 2
Soon after this article was published, I noticed other Vine members were talking on the IRC channel about changing the default Plymouth theme from Script to Spinfinity - okay, okay - that's another solution to avoid the Script theme...
P.S. 3
Then here's yet another canditate from Daisuke-san - looking good. The very best IMHO.
Now we can clearly distinguish the progress bar itself - no confusion here.
I found the following lines on the CMakeLists.txt
in the digikam source code:
# Extract version of libjpeg so that we can use the appropriate dir
# See bug #227313, #228483
FILE(READ "${JPEG_INCLUDE_DIR}/jpeglib.h" jpeglib_h_content)
STRING(REGEX REPLACE ".*#define +JPEG_LIB_VERSION +([0-9]+).*" "\\1" jpeglib_version "${jpeglib_h_content}")
MESSAGE(STATUS "Identified libjpeg version: ${jpeglib_version}")
IF ("${jpeglib_version}" LESS 80)
SET(DIGIKAM_LIBJPEG_DIR libjpeg-62)
ELSE ("${jpeglib_version}" LESS 80)
SET(DIGIKAM_LIBJPEG_DIR libjpeg-80)
ENDIF ("${jpeglib_version}" LESS 80)
while on the other hand VineSeed now has libjpeg-turbo instead of the ancient libjpeg6b.
jpeglib.h
from libjpeg-turbo does NOT have the line starting from #define JPEG_LIB_VERSION
: instead the declaration is in another header file jconfig.h
like this:
#define JPEG_LIB_VERSION 62
So the trivial hack (until the upstream fix this tiny issue) is like this:
--- digikam-1.9.0/CMakeLists.txt.orig 2011-02-28 05:16:18.000000000 +0900
+++ digikam-1.9.0/CMakeLists.txt 2011-06-08 14:10:15.000000000 +0900
@@ -153,7 +153,9 @@
# Extract version of libjpeg so that we can use the appropriate dir
# See bug #227313, #228483
-FILE(READ "${JPEG_INCLUDE_DIR}/jpeglib.h" jpeglib_h_content)
+# VINE: better check jconfig.h in place of jpeglib.h on libjpeg-turbo
+# FILE(READ "${JPEG_INCLUDE_DIR}/jpeglib.h" jpeglib_h_content)
+FILE(READ "${JPEG_INCLUDE_DIR}/jconfig.h" jpeglib_h_content)
STRING(REGEX REPLACE ".*#define +JPEG_LIB_VERSION +([0-9]+).*" "\\1" jpeglib_version "${jpeglib_h_content}")
MESSAGE(STATUS "Identified libjpeg version: ${jpeglib_version}")
]]>
XOrg 1.10.0
、xorg-x11-drv-intel-2.14.0-2vl6.i686
、Adobe Flash Plugin10.2.152.27
で、
を観ようとすると、
。。。。
どこか懐かしさもある、大昔遊んだマイコンのテレビゲームみたいな。。。。
結局、Flash の ハードウェアアクセラレーションを無効にする、というのが正解だった模様です。特定の YouTube 映像のみでおかしくなっていたので、まあなんか特定のエンコーディング用のアクセラレータの問題ではないかと思ってはいたのですが。
なにせ VineSeed でちょうど XOrg 1.10
一式が投入された直後ということもあり、原因はなんだなんだということに。。。
<d> flash10.2からVAAPI/VDPAUつかったh264のアクセラレーションが使われるようになったのだけど
<d> h264のプロファイルによっては壊れる
<d> &一回こわれるとflashプロセスを殺さないと
<d> 全部に影響するっぽい
ということだと。だいさめ 情報サンクス。