<?xml version="1.0" encoding="utf-8" standalone="no"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0" xml:base="http://perltips.twinkle.cc">
<channel>
 <title>Perl Tips</title>
 <link>http://perltips.twinkle.cc</link>
 <description>シリコンバレー在住エンジニアの、Perl、PHP、AJAX、Java、Drupal、Movable Type の小枝集です。</description>
 <language>ja</language>
<xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><item>
 <title>How to Add Bootstrap Multi-level Dropdown Submenu in Drupal</title>
 <link>http://perltips.twinkle.cc/node/348</link>
 <description>Download and install a &lt;a href="https://www.drupal.org/project/bootstrap" title="Bootstrap"&gt;Bootstrap&lt;/a&gt; theme.
Modify the following at bootstrap/templates/menu/system/form-element.func.php:
&lt;code&gt;
/**
 * Overrides theme_form_element().
 */
function bootstrap_form_element(&amp;amp;$variables) {
  $element = &amp;amp;$variables['element'];
  $name = !empty($element['#name']) ? $element['#name'] : FALSE;
  $type = !empty($element['#type']) ? $element['#type'] : FALSE;
  $checkbox = $type &amp;amp;&amp;amp; $type === 'checkbox';
  $radio = $type &amp;amp;&amp;amp; $type === 'radio';
  // Create an attributes array for the wrapping container.
  if (empty($element['#wrapper_attributes'])) {
    $element['#wrapper_attributes'] = array();
  }
  $wrapper_attributes = &amp;amp;$element['#wrapper_attributes'];
  // This function is invoked as theme wrapper, but the rendered form element
  // may not necessarily have been processed by form_builder().
  $element += array(
    '#title_display' =&amp;gt; 'before',
  );&lt;p&gt;&lt;a href="http://perltips.twinkle.cc/node/348"&gt;全文を表示&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://perltips.twinkle.cc/node/348#comments</comments>
 <category domain="http://perltips.twinkle.cc/drupal">Drupal</category>
 <pubDate>Mon, 11 May 2015 22:28:49 +0000</pubDate>
 <dc:creator>admin</dc:creator>
 <guid isPermaLink="false">348 at http://perltips.twinkle.cc</guid>
</item>
<item>
 <title>How to setup Apache SSL (Self-signed Certificate) on Ubuntu 9.04</title>
 <link>http://perltips.twinkle.cc/linux/ubuntu/apache/ssl/settings/en</link>
 <description>&lt;ol&gt;
&lt;li&gt;Install openssl
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo apt-get install openssl&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Create a serect key (e.g. server.key)
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo openssl genrsa -out server.key 4096 (e.g. no password - do not use 2048 byte key)&lt;br /&gt;# sudo openssl genrsa -des3 -out server.key 4096 (do not use 2048 byte key)&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Alternative: Skip (invalidate) a password (e.g. server.key)
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo&amp;nbsp; openssl genrsa -out server.key 4096&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Create a public key (e.g. server.csr)
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo openssl req -new -key server.key -out server.csr&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Create a signed certificate（e.g. server.crt / Expiration is ten (10) years)
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;Copy the keys to an appropriate directory (Note a permission to copy destination)
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo cp server.crt /etc/ssl/certs/; sudo cp server.key /etc/ssl/private/&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;&lt;p&gt;&lt;a href="http://perltips.twinkle.cc/linux/ubuntu/apache/ssl/settings/en"&gt;全文を表示&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://perltips.twinkle.cc/linux/ubuntu/apache/ssl/settings/en#comments</comments>
 <category domain="http://perltips.twinkle.cc/linux">Linux</category>
 <category domain="http://perltips.twinkle.cc/server">サーバ</category>
 <category domain="http://perltips.twinkle.cc/security">セキュリティ</category>
 <pubDate>Sat, 02 Jan 2010 09:34:45 +0000</pubDate>
 <dc:creator>yas</dc:creator>
 <guid isPermaLink="false">345 at http://perltips.twinkle.cc</guid>
</item>
<item>
 <title>Ubuntu 9.04 で、Apache2 の SSL を有効にする（オレオレ証明の設定方法）。</title>
 <link>http://perltips.twinkle.cc/linux/ubuntu/apache/ssl/settings</link>
 <description>手順としては次の通り。
&lt;ol&gt;
&lt;li&gt;openssl をインストール。
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo apt-get install openssl&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;秘密鍵を作る（仮に server.key としよう）。
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo openssl genrsa -out server.key 4096 （パスワードなしの場合、2048 バイトのキーは弱すぎて証明書としてはもはや無効）&lt;br /&gt;# sudo openssl genrsa -des3 -out server.key 4096（パスワードありの場合、2048 バイトのキーは弱すぎて証明書としてはもはや無効）&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;公開鍵を作る（server.csr としよう）。
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo openssl req -new -key server.key -out server.csr&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;署名付の証明書を作る（server.crt としよう。有効期間はオレオレなので 10年くらいでいいだろう＾＾；）。
&lt;div class="codeblock"&gt;&lt;code&gt;# sudo openssl x509 -req -days 3650 -in server.csr -signkey server.key -out server.crt&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;&lt;p&gt;&lt;a href="http://perltips.twinkle.cc/linux/ubuntu/apache/ssl/settings"&gt;全文を表示&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://perltips.twinkle.cc/linux/ubuntu/apache/ssl/settings#comments</comments>
 <category domain="http://perltips.twinkle.cc/linux">Linux</category>
 <category domain="http://perltips.twinkle.cc/internet">インターネット</category>
 <category domain="http://perltips.twinkle.cc/server">サーバ</category>
 <category domain="http://perltips.twinkle.cc/security">セキュリティ</category>
 <pubDate>Fri, 25 Sep 2009 19:54:58 +0000</pubDate>
 <dc:creator>yas</dc:creator>
 <guid isPermaLink="false">344 at http://perltips.twinkle.cc</guid>
</item>
<item>
 <title>CentOS 5.3 で、yum が python 失敗する。</title>
 <link>http://perltips.twinkle.cc/linux/centos/5.3/yum/python/dependency/error</link>
 <description>次のようなエラーでお嘆きのあなたは、
&lt;div class="codeblock"&gt;&lt;code&gt;&amp;nbsp; --&amp;gt; Missing Dependency: /usr/lib64/python2.4 is needed by package libxml2-python-2.6.26-2.1.2.8.x86_64 (updates)&lt;br /&gt;libxslt-python-1.1.17-2.el5_2.2.x86_64 from installed has depsolving problems&lt;br /&gt;&amp;nbsp; --&amp;gt; Missing Dependency: /usr/lib64/python2.4 is needed by package libxslt-python-1.1.17-2.el5_2.2.x86_64 (installed)&lt;br /&gt;gamin-python-0.1.7-8.el5.x86_64 from installed has depsolving problems&lt;br /&gt;&amp;nbsp; --&amp;gt; Missing Dependency: /usr/lib64/python2.4 is needed by package gamin-python-0.1.7-8.el5.x86_64 (installed)&lt;br /&gt;Error: Missing Dependency: /usr/lib64/python2.4 is needed by package libxslt-python-1.1.17-2.el5_2.2.x86_64 (installed)&lt;br /&gt;Error: Missing Dependency: /usr/lib64/python2.4 is needed by package gamin-python-0.1.7-8.el5.x86_64 (installed)&lt;br /&gt;Error: Missing Dependency: /usr/lib64/python2.4 is needed by package libxml2-python-2.6.26-2.1.2.8.x86_64 (updates)&lt;/code&gt;&lt;/div&gt;
yum clean metadata してメタデータをきれいにすれば解決！&lt;p&gt;&lt;a href="http://perltips.twinkle.cc/linux/centos/5.3/yum/python/dependency/error"&gt;全文を表示&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://perltips.twinkle.cc/linux/centos/5.3/yum/python/dependency/error#comments</comments>
 <category domain="http://perltips.twinkle.cc/linux">Linux</category>
 <category domain="http://perltips.twinkle.cc/server">サーバ</category>
 <pubDate>Thu, 13 Aug 2009 00:16:37 +0000</pubDate>
 <dc:creator>yas</dc:creator>
 <guid isPermaLink="false">341 at http://perltips.twinkle.cc</guid>
</item>
<item>
 <title>Linux （Ubuntu）で、ループバックデバイス（loop back device）の数を増やす方法</title>
 <link>http://perltips.twinkle.cc/linux/ubuntu/loopbackdevice/eucalyptus</link>
 <description>Eucalyptus 1.5.1 を Ubuntu 9.04 (Jaunty) にインストールすると、確実に
&lt;div class="codeblock"&gt;&lt;code&gt;You should have at least 32 loop devices&lt;/code&gt;&lt;/div&gt;
というエラーが出て Front-end （eucalyptus-cloud）が&lt;strong&gt;起動できない&lt;/strong&gt;。
&lt;div class="codeblock"&gt;&lt;code&gt;# ls -la /dev/loop*&lt;/code&gt;&lt;/div&gt;
としてみると、loop back device が 0～7 の 8つしかないことに気づく。じゃ増やすには？と、いろいろとググっても /etc/modules の loop の行を loop max_loop=255 にしろとかしか書いてない。
ところが最近の Linux はカーネルに loop back device のモジュールがマージされているようなので、Ubuntu 9.04 (Jaunty) では、
&lt;div class="codeblock"&gt;&lt;code&gt;rmmod loop; modprobe loop max_loop=256 &lt;/code&gt;&lt;/div&gt;
としてもダメだった。なので結論から言うと
&lt;div class="codeblock"&gt;&lt;code&gt;# vi /boot/grub/menu.lst&lt;/code&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://perltips.twinkle.cc/linux/ubuntu/loopbackdevice/eucalyptus"&gt;全文を表示&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://perltips.twinkle.cc/linux/ubuntu/loopbackdevice/eucalyptus#comments</comments>
 <category domain="http://perltips.twinkle.cc/linux">Linux</category>
 <category domain="http://perltips.twinkle.cc/server">サーバ</category>
 <pubDate>Fri, 05 Jun 2009 07:00:00 +0000</pubDate>
 <dc:creator>yas</dc:creator>
 <guid isPermaLink="false">339 at http://perltips.twinkle.cc</guid>
</item>
<item>
 <title>Ubuntu で、Eucalyptus 1.5RC1 を動かす方法</title>
 <link>http://perltips.twinkle.cc/linux/ubuntu/eucalyptus/managed/install/setup</link>
 <description>&lt;span&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;ver.1.5 から kvm on Ubuntu に力を入れている模様。kvm は簡単にインストールできる印象。&lt;/li&gt;
&lt;li&gt;apt-get install eucalyptus-cloud eucalyptus-cc は、同じマシンでよい。MANAGED モードを考えるなら eucalyptus-nc だけは別のマシンにインストールする。よりアマゾンの環境に近づけたいなら MANAGED モードにする（Elastic IP が利用できるから）。&lt;/li&gt;&lt;p&gt;&lt;a href="http://perltips.twinkle.cc/linux/ubuntu/eucalyptus/managed/install/setup"&gt;全文を表示&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://perltips.twinkle.cc/linux/ubuntu/eucalyptus/managed/install/setup#comments</comments>
 <category domain="http://perltips.twinkle.cc/amazon">Amazon</category>
 <category domain="http://perltips.twinkle.cc/linux">Linux</category>
 <category domain="http://perltips.twinkle.cc/server">サーバ</category>
 <pubDate>Thu, 23 Apr 2009 03:36:35 +0000</pubDate>
 <dc:creator>yas</dc:creator>
 <guid isPermaLink="false">335 at http://perltips.twinkle.cc</guid>
</item>
<item>
 <title>Ubuntu で、最低限の LAMP 環境を作る</title>
 <link>http://perltips.twinkle.cc/linux/ubuntu/apache/php/lamp/settings</link>
 <description>Ubuntu サーバをインストールした後、次を実行する（最後の php5-cli は PHP のコマンドラインインターフェイス。おまけ。）
&lt;div class="codeblock"&gt;&lt;code&gt;# apt-get install apache2 mysql-server php5 php5-mysql php5-cli phpmyadmin&lt;/code&gt;&lt;/div&gt;
次に、MySQL データベースを他のマシンからアクセスできるようにする（テストサーバの場合、こちらの方が拡張性があるだろう）。
&lt;div class="codeblock"&gt;&lt;code&gt;# vi /etc/mysql/my.cnf&lt;/code&gt;&lt;/div&gt;
&lt;div class="codeblock"&gt;&lt;code&gt;# bind-address = 127.0.0.1 // の行をコメントアウトして&lt;br /&gt;bind-address = &amp;lt;サーバの IP アドレス&amp;gt; // に変更する。&lt;/code&gt;&lt;/div&gt;
※ ↑ Amazon EC2 の環境で、もしこれで起動が失敗するようになったら bind-address 行自体をコメントにする（すべてのサーバからの接続という意味になる）。
&lt;div class="codeblock"&gt;&lt;code&gt;# mysql -u root -p でログインしてから、以下を実行&lt;/code&gt;&lt;/div&gt;
&lt;code&gt;&lt;p&gt;&lt;a href="http://perltips.twinkle.cc/linux/ubuntu/apache/php/lamp/settings"&gt;全文を表示&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://perltips.twinkle.cc/linux/ubuntu/apache/php/lamp/settings#comments</comments>
 <category domain="http://perltips.twinkle.cc/linux">Linux</category>
 <category domain="http://perltips.twinkle.cc/mysql">MySQL</category>
 <category domain="http://perltips.twinkle.cc/php">PHP</category>
 <category domain="http://perltips.twinkle.cc/server">サーバ</category>
 <category domain="http://perltips.twinkle.cc/database">データベース</category>
 <pubDate>Tue, 27 May 2008 15:00:00 +0000</pubDate>
 <dc:creator>yas</dc:creator>
 <guid isPermaLink="false">343 at http://perltips.twinkle.cc</guid>
</item>
<item>
 <title>Ubuntu の Apache で、Perl/CGI を有効にする方法</title>
 <link>http://perltips.twinkle.cc/linux/ubuntu/apache/perl/settings</link>
 <description>Ubuntu の Apache の設定ファイルの場所は /etc/apache2/site-available/default である。従って、
Perl をデフォルトのディレクトリ /var/www で動かすには、Perl と Apache の関連モジュールを apt-get でインストールした後、次のようにする。
# vi /etc/apache2/site-available/default
&lt;div class="codeblock"&gt;&lt;code&gt;&amp;lt;Directory /var/www/&amp;gt;&lt;br /&gt;&amp;nbsp; Options Indexes FollowSymLinks MultiViews +ExecCGI # ここと&lt;br /&gt;&amp;nbsp; DirectoryIndex index.cgi # ここを追加。index.cgi はおまけ。&lt;br /&gt;&amp;nbsp; AddHandler cgi-script .cgi .pl # もし Perl （拡張子は .cgi か .pl）を有効にしたい場合はこの行を追加&lt;br /&gt;&amp;nbsp; AllowOverride None&lt;br /&gt;&amp;nbsp; Order allow,deny&lt;br /&gt;&amp;nbsp; allow from all&lt;br /&gt;&amp;lt;/Directory&amp;gt;&lt;/code&gt;&lt;/div&gt;</description>
 <comments>http://perltips.twinkle.cc/linux/ubuntu/apache/perl/settings#comments</comments>
 <category domain="http://perltips.twinkle.cc/linux">Linux</category>
 <category domain="http://perltips.twinkle.cc/perl">Perl</category>
 <pubDate>Sun, 25 May 2008 16:00:00 +0000</pubDate>
 <dc:creator>yas</dc:creator>
 <guid isPermaLink="false">342 at http://perltips.twinkle.cc</guid>
</item>
<item>
 <title>Linux で、搭載されているプロセッサのコア数を調べる方法</title>
 <link>http://perltips.twinkle.cc/linux/proc/cpuinfo</link>
 <description>基本
&lt;pre&gt;
cat /proc/cpuinfo | grep processor
&lt;/pre&gt;プロセッサの種類を調べる
&lt;pre&gt;
cat /proc/cpuinfo | grep "model name"
&lt;/pre&gt;HT採用の確認
&lt;pre&gt;
cat /proc/cpuinfo | grep "physical id"
&lt;/pre&gt;</description>
 <comments>http://perltips.twinkle.cc/linux/proc/cpuinfo#comments</comments>
 <category domain="http://perltips.twinkle.cc/linux">Linux</category>
 <category domain="http://perltips.twinkle.cc/server">サーバ</category>
 <pubDate>Fri, 23 May 2008 07:00:00 +0000</pubDate>
 <dc:creator>yas</dc:creator>
 <guid isPermaLink="false">340 at http://perltips.twinkle.cc</guid>
</item>
<item>
 <title>Ubuntu の Apache で、PHP を有効にする方法</title>
 <link>http://perltips.twinkle.cc/linux/ubuntu/apache/php/settings</link>
 <description>Ubuntu の Apache の設定ファイルの場所は /etc/apache2/site-available/default である。従って、
PHP をデフォルトのディレクトリ /var/www で動かすには、PHP と Apache の関連モジュールを apt-get でインストールした後、次のようにする。
# vi /etc/apache2/site-available/default
&lt;div class="codeblock"&gt;&lt;code&gt;&amp;lt;Directory /var/www/&amp;gt;&lt;br /&gt;&amp;nbsp; Options Indexes FollowSymLinks MultiViews +ExecCGI # ここと&lt;br /&gt;&amp;nbsp; DirectoryIndex index.php index.cgi # ここを追加。index.cgi はおまけ。&lt;br /&gt;&amp;nbsp; AddHandler cgi-script .cgi .pl # もし Perl （拡張子は .cgi か .pl）を有効にしたい場合はこの行を追加、「.php」はこの行に追記してはいけない（Internal Server Error となる）&lt;br /&gt;&amp;nbsp; AllowOverride None&lt;br /&gt;&amp;nbsp; Order allow,deny&lt;br /&gt;&amp;nbsp; allow from all&lt;br /&gt;&amp;lt;/Directory&amp;gt;&lt;/code&gt;&lt;/div&gt;</description>
 <comments>http://perltips.twinkle.cc/linux/ubuntu/apache/php/settings#comments</comments>
 <category domain="http://perltips.twinkle.cc/linux">Linux</category>
 <category domain="http://perltips.twinkle.cc/php">PHP</category>
 <category domain="http://perltips.twinkle.cc/server">サーバ</category>
 <pubDate>Tue, 20 May 2008 07:00:00 +0000</pubDate>
 <dc:creator>yas</dc:creator>
 <guid isPermaLink="false">338 at http://perltips.twinkle.cc</guid>
</item>
</channel>
</rss>