<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
   <channel>
      <title>remix.gr.jp</title>
      <link>http://www.remix.gr.jp/service/blog/</link>
      <description></description>
      <language>ja</language>
      <copyright>Copyright 2010</copyright>
      <lastBuildDate>Wed, 11 Aug 2010 05:56:38 +0900</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

            <item>
         <title>ファイルを暗号化された経路で転送 バッチ編</title>
         <description>サーバー
　IPアドレス 192.168.0.1
　　[toshi@localhost toshi]$ cat /etc/vine-release
　　Vine Linux 4.2 (Lynch Bages)
　　[toshi@localhost toshi]$ ssh -V
　　OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006
のtaroアカウントホームディレクトリのファイル address.txt を

クライアント
　IPアドレス 192.168.0.2
　　[toshi@deskpro ~]$ cat /etc/vine-release
　　Vine Linux 5.1 (Cheval Blanc)
　　[toshi@deskpro ~]$ ssh -V
　　OpenSSH_5.2p1, OpenSSL 0.9.8k 25 Mar 2009
のカレントディレクトリへ暗号化された経路で転送。

scp user@192.168.0.1:address.txt .

バッチ準備編よりも簡単な手法。

クライアント作業
●[taro@localhost ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/taro/.ssh/id_rsa):空でエンター
Created directory &apos;/home/taro/.ssh&apos;.
Enter passphrase (empty for no passphrase):空でエンター
Enter same passphrase again:空でエンター
Your identification has been saved in /home/taro/.ssh/id_rsa.
Your public key has been saved in /home/taro/.ssh/id_rsa.pub.
The key fingerprint is:
c5:d2:7a:31:7a:58:d3:cf:a5:7f:8f:48:16:0a:f9:3e taro@client
The key&apos;s randomart image is:
+--[ RSA 2048]----+
| |
| o . |
| . O . .|
| O + o o |
| S o . + |
| = . . . |
| o o o|
| .Eo . .o|
| ... . .|
+-----------------+
●[taro@localhost taro]$ scp ~/.ssh/id_rsa.pub taro@192.168.0.1:~/.ssh/authorized_keys
taro@192.168.0.1&apos;s password:
id_rsa.pub 100%  395  0.4KB/s 00:00
　パスワード省略したい接続元が複数ある場合は、サーバーの ~/.ssh/authorized_keys へ追記する

これだけで終わり。以降、サーバー側の~/.ssh/authorized_keys にクライアントの公開鍵 ~/.ssh/id_rsa.pub が含まれている限りバッチなどでパスワードを省略可能。
●[taro@localhost taro]$ scp taro@192.168.0.1:address.txt .
address.txt 100% 1743 1.7KB/s 00:00

下記は、技術的なメモ。</description>
         <link>http://www.remix.gr.jp/service/blog/2010/08/post_214.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/08/post_214.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">OS</category>
        
        
         <pubDate>Wed, 11 Aug 2010 05:56:38 +0900</pubDate>
      </item>
            <item>
         <title>８人から２チーム対抗ゴルフゲームの組み合わせ</title>
         <description><![CDATA[小学生？の算数問題。
「ｎ個からｍ個選び出す組み合わせの数」は重複を持たない組合せ
ｎ×（ｎ－１）×・・・×（ｎ－ｍ＋１）÷ｍ×（ｍ－１）×・・・×１
より「８人から４人選び出す組み合わせの数」は
（8×7×6×5）÷（4×3×2×1）＝７０通り

さらに組み合わせのパターンを列記するために下記を参考

SQLで数学パズルを解く（組み合わせ論編）

SELECT E1.e AS e1, E2.e AS e2, E3.e AS e3, E4.e AS e4
  FROM Elements E1, Elements E2, Elements E3, Elements E4
 WHERE E1.e < E2.e
   AND E2.e < E3.e
   AND E3.e < E4.e;

<a href="/dat/blog/puzzle/nCm.zip">MsAccess形式</a>
http://www.geocities.jp/mickindex/database/db_puzzle_math_q_cmb.html
http://ja.wikipedia.org/wiki/%E7%B5%84%E5%90%88%E3%81%9B]]></description>
         <link>http://www.remix.gr.jp/service/blog/2010/08/post_213.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/08/post_213.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">etc</category>
        
        
         <pubDate>Tue, 10 Aug 2010 05:17:18 +0900</pubDate>
      </item>
            <item>
         <title>ファイルを暗号化された経路で転送 バッチ準備編</title>
         <description>参考→sshでパスワードなしに
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/447nonpassh.html

サーバ作業
●[taro@server ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/taro/.ssh/id_rsa):
Created directory &apos;/home/taro/.ssh&apos;.
Enter passphrase (empty for no passphrase):英語の合言葉
Enter same passphrase again:英語の合言葉
Your identification has been saved in /home/taro/.ssh/id_rsa.
Your public key has been saved in /home/taro/.ssh/id_rsa.pub.
The key fingerprint is:
c5:d2:7a:31:7a:58:d3:cf:a5:7f:8f:48:16:0a:f9:3e taro@server
The key&apos;s randomart image is:
+--[ RSA 2048]----+
|                 |
|         o .     |
|        . O .   .|
|         O + o o |
|        S o . +  |
|         = . . . |
|          o o   o|
|         .Eo . .o|
|          ... . .|
+-----------------+
●[taro@server ~]$ cat ~/.ssh/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys
●[taro@server ~]$ chmod 600 ~/.ssh/authorized_keys
サーバー作業は以上、</description>
         <link>http://www.remix.gr.jp/service/blog/2010/08/post_212.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/08/post_212.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">OS</category>
        
        
         <pubDate>Thu, 05 Aug 2010 05:12:13 +0900</pubDate>
      </item>
            <item>
         <title>ファイルを暗号化された経路で転送</title>
         <description>クライアント
　IPアドレス 192.168.0.2
　Vine Linux 5.1 (Cheval Blanc)
　OpenSSH_5.2p1, OpenSSL 0.9.8k 25 Mar 2009
から、

カレントディレクトリのファイル address.txt を

サーバー
　IPアドレス 192.168.0.1
　Vine Linux 4.1 (Cos d&apos;Estournel)
　OpenSSH_4.5p1, OpenSSL 0.9.7l 28 Sep 2006
のuserアカウントホームディレクトリへ暗号化された経路で転送。

scp address.txt taro@192.168.0.1:.

逆なら

scp taro@192.168.0.1:address.txt .</description>
         <link>http://www.remix.gr.jp/service/blog/2010/08/post_211.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/08/post_211.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">OS</category>
        
        
         <pubDate>Sun, 01 Aug 2010 05:16:43 +0900</pubDate>
      </item>
            <item>
         <title>検索条件の論理積に相当するアイデア</title>
         <description><![CDATA[あらかじめビット判定した列をVIEWで追加定義・・・それより次のがスッキリ。
<br /><textarea wrap=off cols=55 rows=6>$field = array(
    bindec('00000000000000000000000000000001'),
    bindec('00000000000000000000000000000100'),
    bindec('00000000000000000000000000010000'),
       ：
);</textarea>
<br />のような配列を定義して
<br /><textarea wrap=off cols=55 rows=1>$filter['field'] = new Ethna_AppSearchObject( $field, OBJECT_CONDITION_EQ );</textarea>
<br />と記述すれば次のように生成。
<br /><textarea wrap=off cols=55 rows=1>WHERE field IN (1,4,16)</textarea>
<br />ethnaへ手を入れずに済みＤＢ依存も少ない。]]></description>
         <link>http://www.remix.gr.jp/service/blog/2010/07/post_210.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/07/post_210.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">ethna</category>
        
        
         <pubDate>Thu, 08 Jul 2010 05:10:57 +0900</pubDate>
      </item>
            <item>
         <title>検索条件に論理積を使いたい訳</title>
         <description><![CDATA[Ethna_AppSearchObjectで前回拡張した論理演算子の論理積を使わないと例えば次のように記述。
<br /><textarea wrap=off cols=55 rows=5>$filter['pkey']	= new Ethna_AppSearchObject( null, OBJECT_CONDITION_NE );
$filter['pkey']->addObject( 'field', new Ethna_AppSearchObject( bindec('00000000000000000000000000000001'), OBJECT_CONDITION_EQ ), OBJECT_CONDITION_AND);
$filter['pkey']->addObject( 'field', new Ethna_AppSearchObject( bindec('00000000000000000000000000000100'), OBJECT_CONDITION_EQ ), OBJECT_CONDITION_OR);
$filter['pkey']->addObject( 'field', new Ethna_AppSearchObject( bindec('00000000000000000000000000010000'), OBJECT_CONDITION_EQ ), OBJECT_CONDITION_OR);
　：</textarea>
<br />これは次のように生成。
<br /><textarea wrap=off cols=55 rows=1>WHERE ( (pkey IS NOT NULL) AND field=1 OR field=4 OR field=16 )</textarea>]]></description>
         <link>http://www.remix.gr.jp/service/blog/2010/07/post_209.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/07/post_209.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">ethna</category>
        
        
         <pubDate>Wed, 07 Jul 2010 05:13:15 +0900</pubDate>
      </item>
            <item>
         <title>検索条件に論理積を使いたい</title>
         <description><![CDATA[Ethna_AppSearchObject の 検索条件(Ethna 2.5.0 の標準)
<br />OBJECT_CONDITION_NE
<br />OBJECT_CONDITION_EQ
<br />OBJECT_CONDITION_LIKE
<br />OBJECT_CONDITION_GT
<br />OBJECT_CONDITION_LT
<br />OBJECT_CONDITION_GE
<br />OBJECT_CONDITION_LE
<br />OBJECT_CONDITION_AND
<br />OBJECT_CONDITION_OR
<br />に加え論理演算子の論理積を使えるようにする（MySQL5.0依存）。
<br />Ethna_AppSQL.php の getCondition()で検索条件を判定しSQLを組み立てているので Ethna_AppSQL::getCondition()をオーバーライド。
<br />しかし Ethna_AppObject内でオーバーライドしなければならないメソッドが多数あり、今回急ぎの為 コアのソースを直接修正。
]]></description>
         <link>http://www.remix.gr.jp/service/blog/2010/07/post_208.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/07/post_208.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">ethna</category>
        
        
         <pubDate>Tue, 06 Jul 2010 10:44:32 +0900</pubDate>
      </item>
            <item>
         <title>tarコマンドでバックアップ その３</title>
         <description>/myfolder/mytarget1 配下の全ファイルと
/myfolder/mytarget2 配下の全ファイルを
/myfolder からの相対パスで、カレントディレクトリの backup年月日時分秒.gz ファイルにアーカイブする。

tar -C /myfolder -zcvf backup`LC_ALL=en date +%Y%m%d%H%M%S`.gz mytarget1 mytarget2</description>
         <link>http://www.remix.gr.jp/service/blog/2010/07/tar_2.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/07/tar_2.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">OS</category>
        
        
         <pubDate>Sat, 03 Jul 2010 05:06:04 +0900</pubDate>
      </item>
            <item>
         <title>Vine5.1のviで矢印キーでカーソル移動できない</title>
         <description>Vine4.2 までは vim がディフォルト インストール。
Vine5.1 からは vi がディフォルト インストール。これが原因。
vim を手動インストール。

apt-get install vim-huge

あとは、~/.vimrc を以前のような好みに設定。</description>
         <link>http://www.remix.gr.jp/service/blog/2010/07/vine51vi.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/07/vine51vi.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">OS</category>
        
        
         <pubDate>Fri, 02 Jul 2010 05:55:08 +0900</pubDate>
      </item>
            <item>
         <title>tarコマンドでバックアップ その２</title>
         <description>/myfolder/mytarget1 配下の全ファイルと
/myfolder/mytarget2 配下の全ファイルを
/myfolder からの相対パスで、カレントディレクトリの backup.gz ファイルにアーカイブする。

tar -C /myfolder -zcvf backup.gz mytarget1 mytarget2</description>
         <link>http://www.remix.gr.jp/service/blog/2010/07/tar_1.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/07/tar_1.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">OS</category>
        
        
         <pubDate>Thu, 01 Jul 2010 05:18:57 +0900</pubDate>
      </item>
            <item>
         <title>tarコマンドで増分バックアップ</title>
         <description>古くからある Automating backups with tar
http://www.faqs.org/docs/securing/chap29sec306.html
を、デフォルトが日本語ロケールの vine で実行しようとすると
tarコマンドに渡される日時情報にダブルバイトが含まれて失敗する。
↓
date コマンドの前に LC_ALL=en を追加。
例
LC_ALL=en date +%a</description>
         <link>http://www.remix.gr.jp/service/blog/2010/06/tar.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/06/tar.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">OS</category>
        
        
         <pubDate>Thu, 10 Jun 2010 09:25:42 +0900</pubDate>
      </item>
            <item>
         <title>二台のルーター内のパソコンを起動する</title>
         <description><![CDATA[インターネットを経由して二台のルーター内のパソコンへ<a href="http://www.vector.co.jp/soft/win95/net/se399880.html">マジックパケットを送信してWakeUpOnLAN</a>する。
<br /><textarea wrap=off cols=55 rows=13>インターネット
┃
YBBモデム
┃
┗999.999.999.999       WAN側(グローバルアドレス)
    ■WR7600H
    ┣192.168.0.254     LAN側
    ┃    :
    ┗192.168.0.1       WAN側
        ■WR6600H
        ┣192.168.1.254 LAN側
        ┃    :
        ┗192.168.1.1   ＰＣ(WakeUpOnLAN起動対応パソコン)</textarea>]]></description>
         <link>http://www.remix.gr.jp/service/blog/2010/05/post_207.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/05/post_207.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">Tips</category>
        
        
         <pubDate>Tue, 11 May 2010 06:49:38 +0900</pubDate>
      </item>
            <item>
         <title>自宅のパソコンを遠隔起動する</title>
         <description><![CDATA[インターネットを経由し自宅のパソコンへ<a href="http://www.vector.co.jp/soft/win95/net/se399880.html">マジックパケットを送信してWakeUpOnLAN</a>する。
<br /><textarea wrap=off cols=55 rows=9>インターネット
┃
YBBモデム
┃
┗999.999.999.999       WAN側(グローバルアドレス)
    ■WR7600H
    ┣192.168.0.254     LAN側
    ┃    :
    ┗192.168.0.1       ＰＣ(WakeUpOnLAN起動対応パソコン)</textarea>
<br />この構成では次のようにルーターを設定する。]]></description>
         <link>http://www.remix.gr.jp/service/blog/2010/05/post_206.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/05/post_206.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">Tips</category>
        
        
         <pubDate>Sun, 09 May 2010 06:42:58 +0900</pubDate>
      </item>
            <item>
         <title>二台のルーター内へリモートデスクトップ接続する例</title>
         <description><![CDATA[インターネットを経由して二台のルーター内へリモートデスクトップ接続する
<br /><textarea wrap=off cols=55 rows=13>インターネット
┃
YBBモデム
┃
┗999.999.999.999       WAN側(グローバルアドレス)
    ■WR7600H
    ┣192.168.0.254     LAN側
    ┃    :
    ┗192.168.0.1       WAN側
        ■WR6600H
        ┣192.168.1.254 LAN側
        ┃    :
        ┗192.168.1.1   ＰＣ(Windowsリモートデスクトップサーバー)</textarea>]]></description>
         <link>http://www.remix.gr.jp/service/blog/2010/05/post_205.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/05/post_205.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">Tips</category>
        
        
         <pubDate>Sat, 08 May 2010 06:40:16 +0900</pubDate>
      </item>
            <item>
         <title>二台のルーターを使ってロケフリする例</title>
         <description><![CDATA[プロバイダからルーターが２重となる構成で、インターネット越しからロケフリに接続する。
<br /><textarea wrap=off cols=55 rows=15>インターネット
┃
YBBモデム
┃
┗999.999.999.999         WAN側(グローバルアドレス)
    ■WR7600H
    ┣192.168.0.254       LAN側
    ┃    :
    ┗192.168.0.1         WAN側
        ■WR6600H
        ┣192.168.1.254   LAN側
        ┃    :
        ┗192.168.1.1     WAN側
            ■LF-PK20
            ┗172.29.71.1 LAN側</textarea>
<br />ルーターのUPnP(Universal Plug and Play)を使わない。]]></description>
         <link>http://www.remix.gr.jp/service/blog/2010/05/post_204.html</link>
         <guid>http://www.remix.gr.jp/service/blog/2010/05/post_204.html</guid>
                  <category domain="http://www.sixapart.com/ns/types#category">Tips</category>
        
        
         <pubDate>Fri, 07 May 2010 06:42:35 +0900</pubDate>
      </item>
      
   </channel>
</rss>
