memo.xight.org

2009-05 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
最近 7 日分 / 今月の一覧

2009-05-27 Wed

Google Analyticsのコードを変更

- Summary
Google Analyticsのコードが変更になっている。

- 新JavaScriptのソースコード

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ?
"https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost +
"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
  var pageTracker = _gat._getTracker("UA-xxxxxx-x");
  pageTracker._trackPageview();
} catch(err) {}
</script>


- 旧JavaScriptのソースコード
<script src="http://www.google-analytics.com/urchin.js"
type="text/javascript">
</script>
<script type="text/javascript">
_uacct="UA-xxxxxx-x";
urchinTracker();
</script>


- Reference
トラッキング コードがページに正しく設定されているかどうかを確認するにはどうすればよいですか? - Analytics ヘルプ
http://www.google.com/support/analytics/bin/answer.py?answer=74947

トラッキング コードがページに正しく設定されているかどうかを確認するにはどうすればよいですか? - Analytics ヘルプ
http://www.google.com/support/analytics/bin/answer.py?hl=ja_JP&answer=55480&utm_id=ad

サイトのソース コードを確認するにはどうすればよいですか? - Analytics ヘルプ
http://www.google.com/support/analytics/bin/answer.py?answer=75129

カテゴリ: [Google Analytics]

2009-05-24 Sun

DrupalのTextileモジュールのインストール

- Summary
Textileモジュールのインストールと有効化について。
対象ファイルを展開して、インストールだけでは有効にならない。

- Textileモジュールの配置

% tar xzvf textile-x.x.x.tar.gz
% mv textile /path/to/drupal/modules



- classTextile.php をダウンロードして配置
INSTALL.txtに書いているURLに当該ファイルが存在しなかったので、
以下URLから入手。
http://textpattern.googlecode.com/svn/releases/4.0.8/source/textpattern/lib/classTextile.php

/path/to/drupal/modules/textile/classTextile.php に配置

- 入力書式の追加
http://example.com/path/to/drupal/admin/settings/filters/add
Textileフィルタのみ有効にする。

- コンテンツへの適用
入力書式から Textileを指定する。

- Reference
Textile | drupal.org
http://drupal.org/project/textile

Textile
http://textile.thresholdstate.com/

textpattern - Google Code
http://code.google.com/p/textpattern/

カテゴリ: [Drupal]

EmojiPrint - Thunderbirdで絵文字を表示するアドオン

- Summary
Thunderbirdで、携帯から送られてきた絵文字を、
正しく表示することができるようになるアドオン。
DoCoMo、au、Softbank、Willcomに対応。

- Reference
EmojiPrint
http://www.takaaki.info/addon/emojiprint/

Thunderbirdで携帯メールの絵文字を表示するアドオンを作りました - mizuno_takaakiの日記
http://d.hatena.ne.jp/mizuno_takaaki/20090426/1240756028

カテゴリ: [Thunderbird]

GmailのSMTPでメールを送信した際のFromヘッダ上書き対策

- Summary
GmailのSMTPを利用してメールを送信した際、
Fromを指定していても、Gmailのアカウント名で上書きされる。

- 対策方法 その1
Gmailの設定から「アカウントの設定」にて、「他のメールアドレスを追加」として登録
Fromが一致すればよい。

- 対策方法 その2
Google Appsで当該ドメインのアカウントを作成。

- Reference
Google Apps
http://www.google.com/a/help/intl/ja/

Postfix で、Gmail にメールをリレーする - 私の二次記憶
http://d.hatena.ne.jp/ayokoyama/20061207/p1

カテゴリ: [Gmail]

PostfixからGmail経由でメールを送る方法

- Summary
OB25P (Outbound Port 25 Blocking) 対策でメールの送信設定が必要。
手動でPOP before SMTPに対応するのも手間。
MTAを設定して、GmailのSMTPを利用することにする。

- /etc/postfix/main.cf

# GmailのSMTPサーバを指定
relayhost = [smtp.gmail.com]:587

# TLSにより暗号化
smtp_use_tls = yes

# plain方式の SMTP AUTH認証を有効にする
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_tls_security_options = noanonymous
smtp_sasl_mechanism_filter = plain

# GmailのTLS証明書の妥当性確認のための設定
smtp_tls_CApath = /etc/pki/tls/certs/ca-bundle.crt



- /etc/postfix/sasl_passwdを作成

[smtp.gmail.com]:587 username@gmail.com:password



- /etc/postfix/sasl_passwdの権限変更

# chown root:root /etc/postfix/sasl_passwd
# chmod 600 /etc/postfix/sasl_passwd



- hash形式の /etc/postfix/sasl_passwd.dbを作成

# postmap /etc/postfix/sasl_passwd


- postfixの再起動

# /etc/init.d/postfix restart


- Gmail SMTP サーバーの証明書を正しく検証する
Gmail SMTP サーバーが持っている証明書から、ルート CA を調べる。
上記の openssl s_client セッションから、Thawte Premium Server CA がルート CA だと分かる。

ルート CA のインターネットドメイン thawte.com のルート証明書をダウンロード。
http://www.thawte.com/roots/ からダウンロード
/usr/share/ca-certificates/thawte.com/ 内に展開。

/etc/postfix/main.cf を編集

/usr/share/ca-certificates/thawte.com/Thawte SSLWeb Server Roots/thawte Premium Server CA/Thawte Premium Server CA.pem



- 注意点
From が自分のGmailアカウントで上書きされる。
送信メールが"送信済みメール"フォルダに配置される。

- Reference
linux.matchy.net - 2008-07-24 - Postfix から Gmail 経由でメールを送る
http://linux.matchy.net/archives/35

Postfix で、Gmail にメールをリレーする - 私の二次記憶
http://d.hatena.ne.jp/ayokoyama/20061207/p1

カテゴリ: [Postfix]

PHPMailerでGmailのSMTPを利用する

- Summary
PHPMailerでGmailのSMTPを利用してメールを送信する。
ポート465からSMTP over SSLを利用する。

- Source

<?php
mb_language("japanese");
mb_internal_encoding("UTF-8");
 
require("class.phpmailer.php");
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = 'ssl://smtp.gmail.com:465';
$mailer->SMTPAuth = TRUE;
$mailer->Username = 'user@gmail.com';  // Gmailのアカウント名
$mailer->Password = 'gmail_password';  // Gmailのパスワード
$mailer->From     = 'from@gmail.com';  // Fromのメールアドレス
$mailer->FromName = mb_encode_mimeheader(mb_convert_encoding("Fromの名前","JIS","UTF-8"));
$mailer->Subject  = mb_encode_mimeheader(mb_convert_encoding("メールのタイトル","JIS","UTF-8"));
$mailer->Body     = mb_convert_encoding("メールの内容","JIS","UTF-8");
$mailer->AddAddress('friend@example.com'); // 宛先
// $mailer->AddReplyTo($email, $from);
 
if(!$mailer->Send()) {
   echo "Message was not sent<br/ >";
   echo "Mailer Error: " . $mailer->ErrorInfo;
} else {
   echo "Message has been sent";
}
?>


- Reference
tishon.net - Using PHPMailer with Gmail
http://www.tishon.net/index.php/2008/03/21/phpmailer-gmail/

さぼてん - 2009-02-14 - メールフォーム - PHPmailer+xajax
http://saboten009.blogspot.com/2009/02/phpmailerxajax.html

カテゴリ: [PHP]

PEAR::MailでGmailのSMTPを利用する

- Summary
Pear::MailでGmailのSMTPを利用してメールを送信する。
ポート587からSTARTTLSを利用する。

- Source

<?php
mb_language("japanese");
mb_internal_encoding("UTF-8");
 
require_once 'Mail.php';
 
$params = array(
  'host'     => 'smtp.gmail.com',
  'port'     => 587,
  'auth'     => true,
  'username' => 'example@gmail.com',
  'password' => 'password',
  'debug'    => true,
);
 
$headers = array(
  'From'    => 'example@gmail.com',
  'To'      => 'example@gmail.com',
  'Subject' => mb_encode_mimeheader(mb_convert_encoding("メールのタイトル","JIS","UTF-8"))
);
 
$recipients = 'example@gmail.com';
$body = mb_convert_encoding("メールの内容","JIS","UTF-8");
 
$smtp = Mail::factory('smtp', $params);
$e = $smtp->send($recipients, $headers, $body);
 
if ( PEAR::isError($e) ) echo $e->getMessage() . "\n";
?>


- Reference
たら風呂 - 2007-04-04 - PEAR::MailでGmailのSMTPを使う
http://d.hatena.ne.jp/taraburo/20070404/1175694545

カテゴリ: [PHP]

2009-05-08 Fri

MSOCache という名のディレクトリ

- Summary
いつの間にか、 C:\MSOCache というディレクトリが作成されていた。
Officeのローカルインストールソースというモノらしい。
以下の作業中にメディアを用意する必要がなくなるとのこと。

  - 検出と修復
  - デマンド インストール
  - メンテナンス モード セットアップ
  - Service Pack および修正プログラムのインストール

- Reference
MIcrosoft サポートオンライン - [OFF2003] ローカル インストール ソース (Msocache)
http://support.microsoft.com/default.aspx?scid=kb;ja;825933

カテゴリ: [Windows]

2009-05-04 Mon

Drupalのインストール

- Summary
Drupalをインストールしてみる。
モジュールは cck と views を追加。

- ファイルの移動と権限付与

# mv drupal-x.x/* drupal-x.x/.htaccess /var/www/html
# cp sites/default/default.settings.php sites/default/settings.php



- データベースの作成

# mysqladmin -uroot -p create drupal



- mysqlのテーブルの作成

grant select, insert, update, delete, create, drop, index, alter, create temporary tables, lock tables on drupal.* to drupal@localhost identified by 'XXXXXXXX';
flush privileges;
quit;



- Clean URLの有効化
Clean URLは http://example.com/index.php?q=hogehttp://example.com/hoge のようにアクセスする可能にする機能。
Clean URLの動作にはmod_rewriteが必要。

/path/to/drupal/.htaccess を有効にする。

<Directory /path/to/drupal/>
AllowOverride All
</Directory>



- インストール時にClean URLを有効に設定できなかった場合
  mod_rewriteの有効化、.htaccessのOverrideの設定確認をして apache再起動。
  http://example.com/drupal/?q=admin/settings/clean-urls にアクセスし、
  Clean URLを有効化する。

- ブラウザから drupal をインストール
http://example.com/install.php にアクセス

- cck, viewsモジュールのファイルを配置

% tar xzvf views-6.x-x.x.tar.gz
% mv views /path/to/drupal/sites/all/modules

% tar xzvf cck-6.x-x.x.tar.gz
% mv cck /path/to/drupal/modules



- cck, viewsモジュールを日本語化

% unzip ja-cck-6.x-x.x.zip
% cp ja-cck-6.x/cck.ja.po /path/to/drupal/modules/cck/translations/ja.po

% unzip ja-views-6.x-x.x.zip
% cp ja-views-6.x/cck.ja.po /path/to/drupal/sites/all/modules/views/translations/ja.po



- Reference
Drupal.org
http://drupal.org/

Drupal Japan
http://drupal.jp/

Content Construction Kit (CCK) | drupal.org
http://drupal.org/project/cck

Content Construction Kit (CCK) 日本語翻訳 | DRUPAL*DRUPAL
http://drupalxdrupal.com/project/194

Views | drupal.org
http://drupal.org/project/views

Views 日本語翻訳 | DRUPAL*DRUPAL
http://drupalxdrupal.com/project/196

Perl Tips - 2007-04-6
http://perltips.twinkle.cc/drupal/clean_urls.php

カテゴリ: [Drupal]

2009-04-26 Sun

GoogleアカウントとYouTubeのアカウントを統合する

- Summary
既に取得しているYouTubeアカウントと Googleアカウントの統合の方法.

1. Google アカウントでYouTubeにログイン
2. YouTubeのユーザ名とパスワードを入力し
3. [アカウントをリンク]をクリック

- 注意
既にGoogleアカウントと統合している場合は、一旦アカウントのリンクを解除する必要がある.
以下のURLから,YouTube と Google のアカウントのリンクを解除が行える.
http://www.youtube.com/my_account_unlink

- Reference
YouTube - トラブルシューティング - YouTube アカウントと Google アカウントのリンク
http://www.google.com/support/youtube/bin/answer.py?answer=69964

カテゴリ: [Google]

2009-04-10 Fri

StrokeIt を用いて Google Chrome でマウスジェスチャーを使う

- Summary
StrokeItを用いて Google Chromeでマウスジェスチャーを利用する方法

StrokeItをインストールした後、
下記、sxpファイルを実行することにより、
Google Chromeでマウスジェスチャーを使用することが可能。

- XP用 sxpファイル (GoogleChrome.sxpなどとして保存)

<VERSION>StrokeIt .9.4</VERSION>
<APP name="Google Chrome">
class=Chrome_XPFrame
タブを閉じる {
   gesture = Down-Right
   Ctrl+F4 = keys, hotkey [CTRL_DOWN][F4][CTRL_UP]
}
更新 {
   gesture = Up-Down
   F5 = keys, hotkey [F5]
}
進む {
   gesture = Right
   Shift+BackSpace = keys, hotkey [SHIFT_DOWN][BACK][SHIFT_UP]
}
戻る {
   gesture = Left
   BackSpace = keys, hotkey [BACK]
}
</APP>



- Vista 用 sxpファイル (GoogleChrome.sxpなどとして保存)

<VERSION>StrokeIt .9.4</VERSION>
<APP name="Google Chrome">
class=Chrome_VistaFrame
タブを閉じる {
    gesture = Down-Right
    Ctrl+F4 = keys, hotkey [CTRL_DOWN][F4][CTRL_UP]
}
更新 {
    gesture = Up-Down
    F5 = keys, hotkey [F5]
}
進む {
    gesture = Right
    Shift+BackSpace = keys, hotkey [SHIFT_DOWN][BACK][SHIFT_UP]
}
戻る {
    gesture = Left
    BackSpace = keys, hotkey [BACK]
}
</APP>



- Reference
StrokeIt
http://www.tcbmi.com/strokeit/

- via
窓の杜 - 2008-09-12- 「Google Chrome」でマウスジェスチャーを使う
http://www.forest.impress.co.jp/article/2008/09/12/chromedegesture.html

カテゴリ: [Memo]

Debian GNU/Linux で IPアドレスの変更

- IPアドレスの恒久的な変更
1. /etc/network/interfaces を変更

iface eth0 inet static
address 192.168.0.XX
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1



2. NICを再起動

# ifdown eth0
# ifup eth0


- IPアドレスの一時的な変更

# ifconfig eth0 192.168.0.XXX

カテゴリ: [Debian]

Remember the milk と Rainlendar の同期方法

- Summary
wget を用いた Remember the milk と Rainlendar の同期方法

- スタートアップに wget起動用 バッチファイルを用意

"C:\path\to\wget\wget.exe" -b -a "C:\path\to\wget\log" -O "D:\path\to\ToDo.ics" --http-user=[Remember the milkのユーザ名] --http-password=[Remember the milkのパスワード] --no-check-certificate https://www.rememberthemilk.com/icalendar/[Remember the milkのユーザ名]/


カテゴリ: [Memo]

Google Calendar と Rainlendar の同期方法 - wget 編

- Summary
wget を用いた Google Calendar と Rainlendar の同期方法

- スタートアップに wget起動用 バッチファイルを用意する

"C:\path\to\wget\wget -b -a "C:\path\to\wget\log" -O "D:\path\to\basic.ics" http://www.google.com/calendar/ical/USERID@gmail.com/private/basic.ics


"C:\path\to\wget\wget -b -a "C:\path\to\wget\log" -O "D:\path\to\basic.ics" http://www.google.com/calendar/ical/XXXXXXXXXXXXXXXXXXXXXXXXXX%40group.calendar.google.com/private/basic.ics



- Reference
Heiko Herold's windows wget spot
http://xoomer.virgilio.it/hherold/

コップ水の日記 - 2006-12-09 - Googleカレンダーの予定をRainlendarに表示させるFinal
http://d.hatena.ne.jp/aglassofwater/20061209/p1

カテゴリ: [Memo]

Google Calendar と Rainlendar の同期方法 - GCALDaemon編

- Summary
GCALDaemon を用いた Google Calendar と Rainlendar の同期方法

- config-editor を起動
C:\Program Files\GCALDaemon\bin\config-editor.bat を実行

- config-editor で Googleアカウントを設定
左ペインの "File synchronizer" を選択
"New" ボタンから Google アカウントを設定

- config-editor で 同期元Google Calendarと 出力先ファイルを指定する
"Google Calendar" から 同期元Google Calendarを設定する.
"iCal file" から 出力先ファイルを指定する.

- スタートアップに同期バッチファイルへのショートカットを作成する

"C:\Program Files\GCALDaemon\bin\sync-now.bat"



- Reference
GCALDaemon - Sync Google Calendar with Rainlendar
http://gcaldaemon.sourceforge.net/usage2.html#top

ふじゅんブログ - 2008-09-23 - Googleカレンダーをデスクトップのカレンダー(Rainlendar)と同期したい
http://zzz.jeeet.net/2008/09/google_calenda_rainlendar/

コップ水の日記 - 2006-12-09 - Googleカレンダーの予定をRainlendarに表示させるFinal
http://d.hatena.ne.jp/aglassofwater/20061209/p1

カテゴリ: [Memo]

2009-02-28 Sat

複数台のPCでiTunesを使う方法

- Summary
2Fと3FにあるPCで曲を共有したい.
通常だと,アートワークやレートなどを保存するライブラリファイルが
ローカルに保存されてしまうため,共有が行えない.

通常の共有方法だと,以下の問題が発生する.
  - ファイルのプロパティが編集できない.
  - 再生回数がカウントされない.
  - mixi stationと連携できない.

- 複数台のPCでiTunesを使う方法
1. Shift を押しながら iTunesを起動し,
2. マスタとなるiTunesライブラリファイルを指定する.
   ファイル名は "iTunes Library.itl"

- 結果
成功.
ファイルのプロパティも編集可能.

カテゴリ: [Memo]
2009-05 / 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Color Reference

ChangeLogを検索
携帯電話からアクセス!

カテゴリ

最近の話題

リンク

過去ログ

Google

QR Code

Since
2002-11-28
Update
2009-05-28 15:18
Copyright © 2005 xight.org All Rights Reserved.