memo.xight.org

2011-12-07 Wed

章、節、項で自動連番

- Summary
<ol> タグのネストで自動連番を行ないたい。
counterを利用して実現する。

- Source

ol {
	counter-reset: item;
}
ol li {
	display: block;
}
ol > li::before {
	content: counters( item, "." )". ";
	counter-increment: item;
}


- 章番号を10番から開始したい場合
ol {
	counter-reset: item 9;
}
li ol {
	counter-reset: item;
}
ol li {
	display: block;
}
ol > li::before {
	content: counters( item, "." )". ";
	counter-increment: item;
}


- Reference
今日もガクリ - CSS content プロパティで counters 自動連番
http://blog.zodiac.vc/?p=61

2011-11-19 Sat

less でソースコードに色をつける

- Summary
GNU Source-highlight を利用してソースコードをハイライトする。

- Install

sudo aptitude install source-highlight


- Setting

if [[ -x `which less` ]]; then
	export LESS='-R'
	if [[ -x '/usr/share/source-highlight/src-hilite-lesspipe.sh' ]]; then
		export LESSOPEN='| /usr/share/source-highlight/src-hilite-lesspipe.sh %s'
	fi
fi


- Reference
漢(オトコ)のコンピュータ道: lessでソースコードに色をつける
http://nippondanji.blogspot.com/2011/11/less.html

lessでソースコードに色をつける(Mac OS編) - YAMAGUCHI::weblog
http://d.hatena.ne.jp/ymotongpoo/20111110/1320887575

SSLサーバ証明書インストールチェッカー

- Summary
Googleが信頼しないSSL証明書[2011-09-27-1] の件、
中間証明書の設定ミスだったことが判明。

- Reference
Verisign SSLサーバ証明書インストールチェッカー
https://knowledge.verisign.com/support/ssl-certificates-support/index?page=content&id=AR1130
GeoTrust SSLサーバ証明書インストールチェッカー
https://knowledge.geotrust.com/support/knowledge-base/index?page=content&id=SO9557&actp=LIST
Thawte SSLサーバ証明書インストールチェッカー
https://search.thawte.com/support/ssl-digital-certificates/index?page=content&id=SO9555&actp=LIST

- via
SSLサーバー証明書インストールチェッカー
http://valuessl.net/support/checker.php

2011-11-13 Sun

ESTAの申請

- Summary
初めて ESTA の申請を行うので、メモしておく。

- ESTA申請ページにアクセス
https://esta.cbp.dhs.gov/esta/

- Apply for an Authorization to Travel to the United States
"Apply" (申請する) をクリック

- Disclaimer (免責事項)
各項に同意するなら
"Yes, I have read and understand the information and agree to these terms."
にチェックをして "Next" をクリック

- The Travel Promotion Act of 2009 (2009年 観光促進法)
各項に同意するなら
"Yes, I have read and understand the information and agree to these terms."
にチェックをして "Next" をクリック

- Step1 : Complete Your Application
  - Applicant Information

Family Name | 姓
First (Given) Name | 名
Birth Date | 誕生日
Country of Citizenship | 国籍のある国
Country Where You Live | 現在の居住国


  - Passport Information

Passport Number | パスポートの番号
Passport Issuing Country | パスポートの発行国
Passport Issuing Date | パスポートの発行日
Passport Expiration Date | パスポートの有効期限


  - Travel Information

City Whrer You are Boardning | 搭乗する都市
Carrier Name | 航空会社
Flight Number or Vessel Name | 便名


  - Address While In The United States

Address Line1 | 州、都市名以外
Address Line2 | 滞在するホテル名など
City | 都市名
State | 州


  - Do any of the following apply to you? (Answer Yes or No)
    全部 "No" にチェックする。
    A) 伝染病、身体的または精神的障害を患っていますか? 薬物依存症ですか?
    B) 違法行為 (不道徳な行為、規制薬物) により逮捕または有罪判決を受けたことはありますか?
    C) これまでにスパイ行為、破壊活動、テロリスト活動または集団殺戮に関係した事がありますか?
    D) 米国で働くつもりですか? 国外退去あるいは強制送還されたことがありますか?
    E) 親権を持つ米国市民からその子供を取り上げ拘束し、あるいはその親権を渡さなかったことがありますか?
    F) 米国ビザまたは米国入国を拒否されたことがありますか? または取り消されたことがありますか?
    G) 訴事免責を主張したことがありますか?

  - "Certification" にチェックして "Next" をクリック。

- Step2 : Submit Your Application
  内容を確認する。
  記入した内容が間違っていれば "Previous" をクリックして修正する。
  確認のため、パスポートの番号、姓、国籍の再入力が求められる。
  これらを入力して "Next" をクリック。

- Step3 : Record Your Application Number
Application Number が表示されるので、記録しておく。
"Next" をクリック。

- Step4 : Make Payment
"Pay" をクリックすると、支払いのためのページが表示される。
https://payment.cbp.dhs.gov/payment/pymtsrvc/startPayment.html..... というURL

Billing Address | 都道府県、市区町村以降を記載
Billing Address2 | ビル名があれば記載
City | 市区町村
Country | 国名
State/Province |都道府県
Postal/Zip Code | 郵便番号
Credit Card Type | American Express / Discover (JCB, Diners Club) / Master Card / Visa


"Submit Payment" をクリックしてしばらく待つ。

- Step5 : View Your Application Status

Authorization Approved | 渡航認証許可
Authorization Pending | 渡航認証保留
Travel Not Authorized | 渡航認証拒否


"Authorization Approved" であることを確認し、ページを印刷しておく。

- Reference
米国大使館ESTA(エスタ)申請公式ウェブサイト
http://japan2.usembassy.gov/j/visa/tvisaj-esta2008.html

2011-11-08 Tue

MySQL5.1からMySQL5.5への移行

- Summary
MySQL5.1からMySQL5.5へ移行する手順。

- /etc/mysql/my.cnf
mysqldセクションの
default-character-set の名前が character-set-serverに変更。
language が lc-messages-dir でローカライズ用のディレクトリを指定するように変更。

[mysqld]
#default-character-set=utf8
character-set-server=utf8

#language   = /usr/share/mysql/english
lc-messages-dir = /usr/share/mysql

# ignore_builtin_innodb
# plugin-load=innodb=ha_innodb_plugin.so



- DBのupdate
[ERROR] Native table 'performance_schema'. ... といったエラーが出ていたら、
mysql_upgrade で解決する。

% sudo mysql_upgrade -uroot -p
Enter password:
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
This installation of MySQL is already upgraded to 5.5.17, use --force if you still need to run mysql_upgrade

2011-10-31 Mon

Drupalモジュール XMLSitemap で Duplicate entry エラーが出る場合の対処法

- Summary
XMLSitemap を利用していて、XMLSitemapをリビルドした際に、
Duplicate entry のエラーが発生する。

id, type が PRIMARY KEY になっているのだが、
type のサイズが足りないために発生しているエラーのようだ。

- エラーのサンプル

WP: Duplicate entry '206-taxonomy_ter' for key 'PRIMARY' query: INSERT INTO xmlsitemap (id, type, subtype, loc, language, access, status, status_override, lastmod, priority, priority_override, changefreq, changecount) VALUES (206, 'taxonomy_term', '16', 'taxonomy/term/206', '', 1, 1, 0, 0, 0.5, 0, 0, 0) in /path/to/drupal/site/all/modules/xmlsitemap/xmlsitemap.inc on line 137.


- 解決方法
type のサイズを変更し、
中途半端な値のtypeが入っている可能性があるため、xmlsitemapテーブルを削除。
その後、XMLSitemap をリビルドすれば良い。

mysql> ALTER TABLE xmlsitemap MODIFY type VARCHAR(32);
mysql> DELETE FROM xmlsitemap;


% /path/to/drush --root=/var/www/drupal --uri="http://example.com" xmlsitemap-rebuild


- 変更前のxmlsitemapテーブルのフィールド

mysql> show fields from xmlsitemap;
+-------------------+------------------+------+-----+---------+-------+
| Field             | Type             | Null | Key | Default | Extra |
+-------------------+------------------+------+-----+---------+-------+
| id                | int(10) unsigned | NO   | PRI | 0       |       |
| type              | varchar(12)      | NO   | PRI |         |       |
| subtype           | varchar(32)      | YES  |     | NULL    |       |
| loc               | varchar(255)     | NO   | MUL |         |       |
| language          | varchar(12)      | NO   | MUL |         |       |
| access            | tinyint(4)       | NO   | MUL | 1       |       |
| status            | tinyint(4)       | NO   |     | 1       |       |
| status_override   | tinyint(4)       | NO   |     | 0       |       |
| lastmod           | int(10) unsigned | NO   |     | 0       |       |
| priority          | float            | YES  |     | NULL    |       |
| priority_override | tinyint(4)       | NO   |     | 0       |       |
| changefreq        | int(10) unsigned | NO   |     | 0       |       |
| changecount       | int(10) unsigned | NO   |     | 0       |       |
+-------------------+------------------+------+-----+---------+-------+



- 変更後のxmlsitemapテーブルのフィールド

mysql> show fields from xmlsitemap;
+-------------------+------------------+------+-----+---------+-------+
| Field             | Type             | Null | Key | Default | Extra |
+-------------------+------------------+------+-----+---------+-------+
| id                | int(10) unsigned | NO   | PRI | 0       |       |
| type              | varchar(32)      | NO   | PRI |         |       |
| subtype           | varchar(32)      | YES  |     | NULL    |       |
| loc               | varchar(255)     | NO   | MUL |         |       |
| language          | varchar(12)      | NO   | MUL |         |       |
| access            | tinyint(4)       | NO   | MUL | 1       |       |
| status            | tinyint(4)       | NO   |     | 1       |       |
| status_override   | tinyint(4)       | NO   |     | 0       |       |
| lastmod           | int(10) unsigned | NO   |     | 0       |       |
| priority          | float            | YES  |     | NULL    |       |
| priority_override | tinyint(4)       | NO   |     | 0       |       |
| changefreq        | int(10) unsigned | NO   |     | 0       |       |
| changecount       | int(10) unsigned | NO   |     | 0       |       |
+-------------------+------------------+------+-----+---------+-------+



- Reference
Duplicate entry with taxonomy term : drupal.org
http://drupal.org/node/794924

XML sitemap | drupal.org
http://drupal.org/project/xmlsitemap

2011-09-29 Thu

MyISAM から InnoDB への移行

- /etc/mysql/my.cnf

# InnoDB plugin enable
ignore_builtin_innodb
plugin-load=innodb=ha_innodb_plugin.so

default_storage_engine = InnoDB
innodb_file_format = Barracuda
innodb_file_per_table
innodb_flush_method = O_DIRECT



- MySQLの再起動

/etc/init.d/mysql restart


- InnoDBが有効になっているか確認

mysql> SHOW VARIABLES LIKE 'innodb%';
| innodb_file_format        | Barracuda     |
| innodb_file_format_check  | Barracuda     |
| innodb_file_per_table     | ON            |
| innodb_flush_method       | O_DIRECT      |



- ALTER TABLE の実行

ALTER TABLE tablename ENGINE InnoDB ROW_FORMAT=Compressed;


2011-09-27 Tue

Googleが信頼しないSSL証明書

- Summary
SSLの設定をしたら、Googleからこんなメールが届いた。
RapidSSLを利用しているのだが…。

ウェブマスター様

サイト https://example.com/ で使用している SSL 証明書がウェブ ブラウザによって認識されません。このままでは、ユーザーがこのサイトにアクセスしようとしたときに、ほとんどのブラウザでアクセスがブロックされるか、セキュリティ警告メッセージが表示されるおそれがあります。

この問題を解決するには、ウェブ ブラウザによって信頼されている認証局(CA)から新しい SSL 証明書を取得してください。

お手数をお掛けしますが、何卒ご理解とご協力賜りますようお願い申し上げます。

Google ウェブ クロール チーム


- [2011-11-19] 追記
中間証明書の設定ミスだった。[2011-11-19-1]

最近 7 日分 / 今月の一覧