パンプキンスパイスラテ

IT系のことが多めの日記帳です

fatal: bad config value for 'core.hidedotfiles' in .git/config でgit pushが失敗する場合の対処法

Windows7で発生。
下記をmsysgitで実行するか、

git config core.hidedotfiles "false"

TortoiseGitのSetting - Configの「Edit local .gitconfig」で

[core]
...
 hidedotfiles = false

を追加する。

hidedotfilesは "隠しフラグを設定しないようにするオプション" らしい。
参考:HugeDomains.com - Nerdground.com is for sale (Nerdground)

Git関連書籍をリストアップしてみる

いまさらだけど個人的な開発でGitを使っていこうと思い、Gitの書籍を探してみた。オススメ順に紹介する。

入門git

入門git

入門git

バージョン管理ツールgitの実践的な解説書!
git(ギット)は、オープンソースな分散型のバージョン管理ツールであり、ここ数年で急速にユーザを増やしている。本書は、gitの実践的な解説書である” Pragmatic Version Control Using Git ”の日本語版で、ユーザにとって必要な知識を簡潔に解説している。

簡潔でわかりやすく、翻訳もなかなか良いらしい。本格的にGitを使おうとすると物足りないのであくまで「入門書」としての書籍らしい。

入門Git

入門Git

入門Git

基本操作から内部構造までGitの開発責任者がすべての疑問に応える。

同名の入門gitより1ヶ月後に発売された本書。著者はGitのメンテナなのでかなり詳細な使い方が書かれているらしい。ただその分「入門書」としては難しいらしく、さらに構成もあまり良くなく読みづらいとのこと。「入門git」である程度理解してからGitをもっと使いこなしたくなったら「入門Git」に手を出すのが良さそう。
こちらも参考に:404 Blog Not Found:#git >>>> バージョン管理システム - 書評 - 入門Git

実用Git

実用Git

実用Git

オープンソースの分散バージョン管理システム「Git」の解説書。
Gitには、開発および共同作業を進めるうえで便利な機能が数多く実装されています。しかし、その柔軟性の高さが原因でGitをどのように使うのが最も効率的か十分に理解していないユーザーが多いのも事実です。
本書ではGitを使ってソフトウェアの開発プロジェクトを追跡、マージ、管理する方法をステップバイステップで明解かつ丁寧に解説します。読者はGitが持つ多くの機能を効率よく使えるようになるでしょう。
日本語版では、Gitで日本語を利用する方法、Gitベースの開発プロジェクト用ホスティングサービスであるGitHubについての解説を加筆しました。

オライリー本なのにこの順位。どうやら原書は結構評価は高いんだけど、翻訳がヒドイらしい。それもかなり。翻訳本にはよくある事だけど、これは原書がかなりの良本らしいのでとても残念。いつかは原書を頑張って読んでみようかな。

Version Control with Git

Version Control with Git

Version Control with Git takes you step-by-step through ways to track, merge, and manage software projects, using this highly flexible, open source version control system. Git permits virtually an infinite variety of methods for development and collaboration. Created by Linus Torvalds to manage development of the Linux kernel, it's become the principal tool for distributed version control. But Git's flexibility also means that some users don't understand how to use it to their best advantage. Version Control with Git offers tutorials on the most effective ways to use it, as well as friendly yet rigorous advice to help you navigate Git's many functions. With this book, you will: * Learn how to use Git in several real-world development environments * Gain insight into Git's common-use cases, initial tasks, and basic functions * Understand how to use Git for both centralized and distributed version control * Use Git to manage patches, diffs, merges, and conflicts * Acquire advanced techniques such as rebasing, hooks, and ways to handle submodules (subprojects) * Learn how to use Git with Subversion Git has earned the respect of developers around the world. Find out how you can benefit from this amazing tool with Version Control with Git.

Gitによるバージョン管理

Gitによるバージョン管理

Gitによるバージョン管理

基本的な使い方から、少し進んだ使いこなしまで、バージョン管理ツールGitを解説!
バージョン管理ツールGitは、高機能な反面、望みどおりの結果を得るには少し慣れが必要です。本書は、Gitを使っていて実際によく出会う状況やワークフローを例に、基本的な使い方からその先まで、場面に応じた使い方を解説します。

2011/10/22なので現時点ではまだ未発売の書籍。唯一の翻訳本では無いので期待。

JR東日本 青梅線 拝島駅での青梅ライナー乗車券購入のコツ

参考になる人がどれだけいるかわからないけどメモ。

仕組み

朝6:37発のJR青梅線 拝島駅での青梅ライナー(参考:中央ライナー・青梅ライナー - Wikipedia)乗車券は駅のホームで6:15頃から駅員が手売りをしている。
乗車券は、グリーン車700円、普通席500円。
停車駅は、青梅駅河辺駅拝島駅立川駅新宿駅、東京駅で、乗車可能なのは、青梅駅河辺駅拝島駅立川駅のみ。
各駅ごとに◯号車から◯号車と、買える乗車券が決められており、拝島駅では、7号車のグリーン車、8〜11号車の普通席で、最後尾11号車の進行方向左側の席はペア席(セット)優先となっている(あらかじめホッチキスで乗車券を留めて用意してある)。
基本的に細かい座席指定はできないけど、窓側、通路側、◯号車などの希望を伝えると、ある程度選んでくれる。
ペア席も11号車以外でも席さえあれば乗車可能だ。
ちなみに、8〜10号車の乗車券が売り切れると、11号車のペア席として確保していたものをバラけさせて売り始めるようだ。

乗車券購入のコツ

1人の場合

当然だけど、窓側が人気なので早めに列に並んだほうが良い。
8号車から11号車(進行方向右側のみ)まであるので、販売開始の6:15分までに並べばほぼ確実に購入できるだろう。

ペアの場合

11号車で構わなければ、結構ギリギリまで買える。が、日によって行列がものすごいことになるので、早めに列に並ぶほうが良い。
「11号車で構わなければ」というのがポイントで、実は何も席を指定せずにペア席の乗車券を購入すると、自動的に11号車になってしまう。
そのため、普段あまり青梅ライナーに乗らない旅行者や子供連れ、遊びに出かける主婦達などが多いのが11号車なのである。
彼ら(彼女ら)は、他の新宿駅または東京駅まで寝たい通勤客と違い、旅行気分なのでお喋りがヒドい。
確かに特急電車で楽しいのかもしれないが、こちらとしてはかなり迷惑だ。
つまり、11号車は通勤客にはオススメできない車両なのである。
だから、ペア席でも乗車券購入時に、「11号車以外で」とリクエストすべき。
隣同士の席がなかったとしても、11号車に乗るくらいなら、席がバラバラになってでもよいので、11号車は絶対に避けるべきである。

乗車券購入後

早めに乗車券を購入できたら、階段を登って左側にあるミスタードーナツで、電車を待つことをオススメする。
モーニングセット(好きなドーナツ+カフェオレ)が300円で買えるのだ(カフェオレ単品は270円なので実質ドーナツを30円で買えることになる)。しかもカフェオレは店内ならお代わり自由だ。

それでは良い青梅ライナーライフを。

Microsoft Exchange Server 2010「Outlook Web App」の対応ブラウザについて調べてみた

ブラウザによって、"Full version" のPremium OWA と "Light version" のLight OWAに自動的に振り分けられるらしい。Premium OWA対象ブラウザではLight OWAを選択して利用することも可能だけど逆は無理。

きっかけ

iPhoneSafariでアクセスすると、「Outlook Web App Light を使用する」にチェックを入れていないのに自動的にLightモードになってしまったので。

Wikipedia

Exchange 2010 requires Internet Explorer 7 or later, Mozilla Firefox 3.01 and later, Google Chrome or Apple Safari 3.1 and later for full functionality, however performs checks on the operating system type to restrict Mac OS X and Linux users to Firefox or Safari, thereby making Google Chrome only officially compatible on their Windows operating system even though there is very little difference in their JavaScript and rendering capabilities between platforms.

Outlook on the web - Wikipedia, the free encyclopedia

まとめてみた

OS Browser Premium OWA Light OWA
Windows Internet Explorer 7以上 Yes Yes
Windows,Mac Google Chrome 3.0.195.27以上 Yes Yes
Linux Google Chrome No Yes
Windows,Mac,Linux Mozilla Firefox 3.0.1以上 Yes Yes
Mac Apple Safari 3.1以上 Yes Yes
Windows Apple Safari No Yes
Windows,Mac,Linux Opera No Yes

上記以外は、Light OWAのみ。

ちなみに単にUserAgentを見ているだけなので偽装すれば対象外ブラウザでもPremium OWAにアクセスできます。動作は保証されていないので要注意ですが。

MySQLのexpire_logs_daysの勘違い

The number of days for automatic binary log file removal. The default is 0, which means “no automatic removal.” Possible removals happen at startup and when the binary log is flushed.

MySQL :: MySQL 5.7 Reference Manual :: 6.1.5 Server System Variables

「expire_logs_days」は「○日前までのログを保存する」という設定だったのに、「1日1ファイル」と思い込んでしまい、設定した日付分が保存されていない!と勘違いしてしまった。
そもそもbinary logは容量でローテーションされているのだった・・。

max_binlog_size

バイナリ ログ ファイルへの書き込みがログ ファイル サイズと干渉し、この値を超える場合、バイナリ ログをローテートする。(現行 ファイルを閉じて、次のファイルを開ける。) 設定可能値は、4096 バイト以上 1 GB (デフォルト) 以下。

MySQL :: MySQL 5.6 リファレンスマニュアル :: 5.1.4 サーバーシステム変数

参考:MySQLでバイナリログを定期的に削除するmy.cnfの設定(expire_logs_days) - ドラあり!*ドラゴンに挑むアリの物語 ** Python使いの日々

眠眠打破、強強打破を超えた!?目覚ましドリンク「めざまし太郎」

ついに発見。眠眠打破強強打破を超える目覚ましドリンク。

めざまし太郎
http://www.youkico.co.jp/mesamashi.html

中央高速道路の下り石川パーキングエリアに売ってたんだけど、他でなかなか見ないんだよね。

★高速道路のサービスエリア、パーキングエリアでおなじみの眠気取りドリンクです。
★どらいぷに、残業に、テスト勉強に、眠くなったときの強い見方です。

やっぱり高速道路で売ってるやつなのか。
…ん?

どらいぷに

どらいぷww

成分はだいたい同じだと思うけど、眠眠打破系より効く気がした。

PHP5.3.8のWindows環境にPEARをインストールする方法

phpをインストールしたフォルダに go-pear.bat というバッチファイルがあります。

http://www.bnote.net/windows/windows/win_pear.shtml

ないよ…。
PHP5.3.8にはgo-pear.batは入ってないみたいなので他の方法を探した。

go-pear.phar

下記からダウンロード。
http://pear.php.net/go-pear.phar
PHPをインストールしたディレクトリに「pear」フォルダを作ってそこに配置。

インストール実行

C:\php\pear>php go-pear.phar

Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : C:\php\pear
 2. Temporary directory for processing            : C:\php\pear\tmp
 3. Temporary directory for downloads             : C:\php\pear\tmp
 4. Binaries directory                            : C:\php\pear
 5. PHP code directory ($php_dir)                 : C:\php\pear\pear
 6. Documentation directory                       : C:\php\pear\docs
 7. Data directory                                : C:\php\pear\data
 8. User-modifiable configuration files directory : C:\php\pear\cfg
 9. Public Web Files directory                    : C:\php\pear\www
10. Tests directory                               : C:\php\pear\tests
11. Name of configuration file                    : C:\Windows\pear.ini
12. Path to CLI php.exe                           : C:\php

1-12, 'all' or Enter to continue:
Beginning install...
PEAR_Config::writeConfigFile fopen('C:\Windows\pear.ini','w') failed (fopen(C:\W
indows\pear.ini): failed to open stream: Permission denied)

C:\Windows\pear.ini に書き込めないよ!というエラー。
よく見ると、

11. Name of configuration file : C:\Windows\pear.ini

これだけWindowsディレクトリに書きこむようになっている。これをPHPのインストールディレクトリに変更した。

C:\php\pear>php go-pear.phar

Are you installing a system-wide PEAR or a local copy?
(system|local) [system] :

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : C:\php\pear
 2. Temporary directory for processing            : C:\php\pear\tmp
 3. Temporary directory for downloads             : C:\php\pear\tmp
 4. Binaries directory                            : C:\php\pear
 5. PHP code directory ($php_dir)                 : C:\php\pear\pear
 6. Documentation directory                       : C:\php\pear\docs
 7. Data directory                                : C:\php\pear\data
 8. User-modifiable configuration files directory : C:\php\pear\cfg
 9. Public Web Files directory                    : C:\php\pear\www
10. Tests directory                               : C:\php\pear\tests
11. Name of configuration file                    : C:\Windows\pear.ini
12. Path to CLI php.exe                           : C:\php

1-12, 'all' or Enter to continue: 11 # 11でEnter
(Use $prefix as a shortcut for 'C:\php\pear', etc.)
Name of configuration file [C:\Windows\pear.ini] : C:\php\pear.ini # 別の場所を指定
Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type 'all' to change all of them or simply press Enter to
accept these locations.

 1. Installation base ($prefix)                   : C:\php\pear
 2. Temporary directory for processing            : C:\php\pear\tmp
 3. Temporary directory for downloads             : C:\php\pear\tmp
 4. Binaries directory                            : C:\php\pear
 5. PHP code directory ($php_dir)                 : C:\php\pear\pear
 6. Documentation directory                       : C:\php\pear\docs
 7. Data directory                                : C:\php\pear\data
 8. User-modifiable configuration files directory : C:\php\pear\cfg
 9. Public Web Files directory                    : C:\php\pear\www
10. Tests directory                               : C:\php\pear\tests
11. Name of configuration file                    : C:\php\pear.ini
12. Path to CLI php.exe                           : C:\php

1-12, 'all' or Enter to continue:
Beginning install...
Configuration written to C:\php\pear.ini...
Initialized registry...
Preparing to install...
installing phar://C:/php/pear/go-pear.phar/PEAR/go-pear-tarballs/Archive_Tar-1.3
.7.tar...
installing phar://C:/php/pear/go-pear.phar/PEAR/go-pear-tarballs/Console_Getopt-
1.3.0.tar...
installing phar://C:/php/pear/go-pear.phar/PEAR/go-pear-tarballs/PEAR-1.9.4.tar.
..
installing phar://C:/php/pear/go-pear.phar/PEAR/go-pear-tarballs/Structures_Grap
h-1.0.4.tar...
installing phar://C:/php/pear/go-pear.phar/PEAR/go-pear-tarballs/XML_Util-1.2.1.
tar...
install ok: channel://pear.php.net/Archive_Tar-1.3.7
install ok: channel://pear.php.net/Console_Getopt-1.3.0
install ok: channel://pear.php.net/Structures_Graph-1.0.4
install ok: channel://pear.php.net/XML_Util-1.2.1
install ok: channel://pear.php.net/PEAR-1.9.4
PEAR: Optional feature webinstaller available (PEAR's web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's PHP-GTK2-based installer)

PEAR: To install optional features use "pear install pear/PEAR#featurename"

******************************************************************************
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
<C:\php\pear\pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.


Would you like to alter php.ini <C:\php\php.ini>? [Y/n] : y # php.iniの変更の同意を求められるので「Y」

php.ini <C:\php\php.ini> include_path updated.

Current include path           : .;c:\php\includes
Configured directory           : C:\php\pear\pear
Currently used php.ini (guess) : C:\php\php.ini
Press Enter to continue:

** WARNING! Old version found at C:\php\pear, please remove it or be sure to use
 the new c:\php\pear\pear.bat command

The 'pear' command is now at your service at c:\php\pear\pear.bat

** The 'pear' command is not currently in your PATH, so you need to
** use 'c:\php\pear\pear.bat' until you have added
** 'C:\php\pear' to your PATH environment variable.

Run it without parameters to see the available actions, try 'pear list'
to see what packages are installed, or 'pear help' for help.

For more information about PEAR, see:

  http://pear.php.net/faq.php
  http://pear.php.net/manual/

Thanks for using go-pear!



* WINDOWS ENVIRONMENT VARIABLES *
For convenience, a REG file is available under C:\php\pearPEAR_ENV.reg .
This file creates ENV variables for the current user.

Double-click this file to add it to the current user registry.

これで完了。

環境変数に追加

C:\php\pear

これでどこでもpearコマンドが使えるようになる。