えちゆちのめもめも

えちゆちのめもめも

覚え書きです。

Amebaでブログを始めよう!
前にopensuseでADのドメイン参加時、ドメインを,localにしとくとnsswich..conf修正必要って書いてたのだがやっと理由が分かったのでメモ。

avahiのせい。avahiが.localで同一セグメント内攻めていくかららしい。

hostのところnsswich.confのmdns4_minimal [NOTFOUND=return]のmdnsってよく見てみればmDNSね...

解決法は、ネットで検索かけると、avahi使い続けるのなら/etc/avahi/avahi-daemon.conf のdomain-name=localの.localを.hogeとかにするとか、やめる場合はavahi無効にするとか、アンインストールするとかいろいろあるみたい。

ここしばらくlinuxのminimalインストールした
サーバしか相手にしてなくて、久しぶりにGUI持つクライアント環境触ってたら発覚。

sambaつながらなくてpingでホスト名のみで打つとOKで、
.localのフルドメイン名で打つとNGって現象にて調べてたら発覚。

いじょ

Access 2010(32bit)がインストールされている(もしくはAccess2010以降の再配布可能なモジュールがインストールされていればいけると思う)のを前提としてかつOSはWin8,1の64ビット版

いろいろなサイトを参考にしてみてうまくいったのでメモ。

データベースに含まれているシステムテーブルでないテーブルのText型フィールドのみ対象。
メモなんでコメントなし。

こんな感じ。


option explicit
const accsdbpath = "C:\hoge\hoge.accdb"
const dbByte = 2
dim sh, engine, args, e, cmd
set sh = createobject("wscript.shell")
if sh.environment("Process").item("PROCESSOR_ARCHITECTURE") <> "x86" then
    if not wscript.arguments.count = 0 then
        for each e in wscript.arguments
          args = args & " """ & e & """"
        next
    end if
    if instr(lcase(wscript.fullname), "wscript") > 0 then
        engine = "wscript.exe"
    else
        engine = "cscript.exe"
    end if
    cmd = """" &  sh.environment("process").item("windir") & "\syswow64\" & engine & """ """ & wscript.scriptfullname & """" & args
    sh.run cmd
    wscript.quit
else
    main 
end if
sub main()
    dim dao, db, tdf, f, p,ip
    set dao = createobject("DAO.DBEngine.120")
    set db = dao.opendatabase(accsdbpath)
    for each tdf in db.tabledefs
        if tdf.attributes = 0 then
            for each f in tdf.fields
                if f.type = 10 then
                    on error resume next
                    f.properties("IMEMode") = 2
                    if err.number <> 0 then
                        err.clear: on error goto 0
                        set ip = f.createproperty("IMEMode", dbByte, 2)
                        f.properties.append ip
                        set ip = nothing
                    else
                        on error goto 0
                    end if
                end if
            next
        end if
    next
    set db = nothing
    set dao = nothing
    msgbox "終了しました!"
end sub


いじょ!
mediatombインストールしたのだがサムネイル作成されなかった。いろいろコンフィグいじってたらとりあえずサムネイルができたんで取り急ぎメモ。

いろんなサイト参照して適当に修正したらできたがいらないのもあるかも。
どれが必要でどれがいらないかは気分が乗ったら検証してみよう。

<?xml version="1.0" encoding="UTF-8"?>
<config version="2" xmlns="http://mediatomb.cc/config/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/2 http://mediatomb.cc/config/2.xsd">
  <server>
    <ui enabled="yes" show-tooltips="yes">
      <accounts enabled="no" session-timeout="30">
        <account user="mediatomb" password="hogehoge"/>
      </accounts>
    </ui>
    <name>MediaTomb</name>
    <udn>uuid:hogehoge-0000-0000-0000-000000000000</udn>
    <home>/etc/mediatomb</home>
    <webroot>/usr/share/mediatomb/web</webroot>
    <storage>
      <sqlite3 enabled="no">
        <database-file>mediatomb.db</database-file>
      </sqlite3>
      <mysql enabled="yes">
        <host>localhost</host>
        <username>mediatomb</username>
	<password>hogehoge</password>
        <database>mediatomb</database>
      </mysql>
    </storage>
    <protocolInfo extend="yes"/><!-- For PS3 support change to "yes" -->
    <!--
       Uncomment the lines below to get rid of jerky avi playback on the
       DSM320 or to enable subtitles support on the DSM units
    -->
    <!--
    <custom-http-headers>
      <add header="X-User-Agent: redsonic"/>
    </custom-http-headers>

    <manufacturerURL>redsonic.com</manufacturerURL>
    <modelNumber>105</modelNumber>
    -->
    <!-- Uncomment the line below if you have a Telegent TG100 -->
    <!--
       <upnp-string-limit>101</upnp-string-limit>
    -->
    <extended-runtime-options>
<!-- 以下追加 (これいらないかも)-->
<ffmpegthumbnailer enabled="yes">
<thumbnail-size>128</thumbnail-size>         <seek-percentage>5</seek-percentage>         <filmstrip-overlay>yes</filmstrip-overlay>         <workaround-bugs>no</workaround-bugs>         <image-quality>8</image-quality>       </ffmpegthumbnailer>       <mark-played-items enabled="no" suppress-cds-updates="yes">         <string mode="prepend">*</string>         <mark>           <content>video</content>         </mark>       </mark-played-items>     </extended-runtime-options>   </server>   <import hidden-files="no">     <filesystem-charset>UTF-8</filesystem-charset>     <metadata-charset>CP932</metadata-charset>     <scripting script-charset="UTF-8">       <common-script>/usr/share/mediatomb/js/common.js</common-script>       <playlist-script>/usr/share/mediatomb/js/playlists.js</playlist-script>       <virtual-layout type="builtin">         <import-script>/usr/share/mediatomb/js/import.js</import-script>       </virtual-layout>     </scripting>     <mappings>       <extension-mimetype ignore-unknown="no">         <map from="jpg" to="image/jpeg"/>         <map from="jpeg" to="image/jpeg"/>         <map from="gif" to="image/gif"/>         <map from="png" to="image/png"/>         <map from="m4v" to="video/mp4"/>         <map from="mp4" to="video/mp4"/>         <map from="mpg" to="video/mpeg"/>         <map from="mpeg" to="video/mpeg"/>         <map from="mp3" to="audio/mpeg"/>         <map from="ogx" to="application/ogg"/>         <map from="ogv" to="video/ogg"/>         <map from="oga" to="audio/ogg"/>         <map from="ogg" to="audio/ogg"/>         <map from="ogm" to="video/ogg"/>         <map from="asf" to="video/x-ms-asf"/>         <map from="asx" to="video/x-ms-asf"/>         <map from="wma" to="audio/x-ms-wma"/>         <map from="wax" to="audio/x-ms-wax"/>         <map from="wmv" to="video/x-ms-wmv"/>         <map from="wvx" to="video/x-ms-wvx"/>         <map from="wm" to="video/x-ms-wm"/>         <map from="wmx" to="video/x-ms-wmx"/>         <map from="m3u" to="audio/x-mpegurl"/>         <map from="pls" to="audio/x-scpls"/>         <map from="flv" to="video/x-flv"/>         <map from="mkv" to="video/x-matroska"/>         <map from="mka" to="audio/x-matroska"/>         <!-- Uncomment the line below for PS3 divx support -->         <map from="avi" to="video/divx"/>         <!-- Uncomment the line below for D-Link DSM / ZyXEL DMA-1000 -->         <!-- <map from="avi" to="video/avi"/> -->       </extension-mimetype>       <mimetype-upnpclass>         <map from="audio/*" to="object.item.audioItem.musicTrack"/>         <map from="video/*" to="object.item.videoItem"/>         <map from="image/*" to="object.item.imageItem"/>       </mimetype-upnpclass>       <mimetype-contenttype>         <treat mimetype="audio/mpeg" as="mp3"/>         <treat mimetype="application/ogg" as="ogg"/>         <treat mimetype="audio/x-flac" as="flac"/>         <treat mimetype="image/jpeg" as="jpg"/>         <treat mimetype="audio/x-mpegurl" as="playlist"/>         <treat mimetype="audio/x-scpls" as="playlist"/>         <treat mimetype="audio/x-wav" as="pcm"/>         <treat mimetype="audio/L16" as="pcm"/>         <treat mimetype="video/x-msvideo" as="avi"/>         <treat mimetype="video/mp4" as="mp4"/>         <treat mimetype="audio/mp4" as="mp4"/>         <treat mimetype="application/x-iso9660" as="dvd"/>         <treat mimetype="application/x-iso9660-image" as="dvd"/>       </mimetype-contenttype>     </mappings>   </import>
<!-- 以下修正 enabled noからyes -->
  <transcoding enabled="yes">
     <mimetype-profile-mappings>
    <transcode mimetype="video/x-flv" using="vlcmpeg"/>
<transcode mimetype="application/ogg" using="vlcmpeg"/>       <transcode mimetype="application/ogg" using="oggflac2raw"/>       <transcode mimetype="audio/x-flac" using="oggflac2raw"/>
<!-- 以下追加 -->
<transcode mimetype="video/avi" using="video-thumbnail"/>     <transcode mimetype="video/divx" using="video-thumbnail"/>     <transcode mimetype="video/mpeg" using="video-thumbnail"/>     <transcode mimetype="video/x-ms-wmv" using="video-thumbnail"/>    </mimetype-profile-mappings>     <profiles>       <profile name="oggflac2raw" enabled="no" type="external">         <mimetype>audio/L16</mimetype>         <accept-url>no</accept-url>         <first-resource>yes</first-resource>         <accept-ogg-theora>no</accept-ogg-theora>         <agent command="ogg123" arguments="-d raw -o byteorder:big -f %out %in"/>         <buffer size="1048576" chunk-size="131072" fill-size="262144"/>       </profile>       <profile name="vlcmpeg" enabled="no" type="external">         <mimetype>video/mpeg</mimetype>         <accept-url>yes</accept-url>         <first-resource>yes</first-resource>         <accept-ogg-theora>yes</accept-ogg-theora>         <agent command="vlc" arguments="-I dummy %in --sout #transcode{venc=ffmpeg,vcodec=mp2v,vb=4096,fps=25,aenc=ffmpeg,acodec=mpga,ab=192,samplerate=44100,channels=2}:standard{access=file,mux=ps,dst=%out} vlc:quit"/>         <buffer size="14400000" chunk-size="512000" fill-size="120000"/>       </profile> <!-- 以下追加 -->       <profile name="video-thumbnail" enabled="yes" type="external"> <mimetype>image/jpeg</mimetype> <accept-url>yes</accept-url> <thumbnail>yes</thumbnail> <resolution>128x128</resolution> <agent command="/usr/local/bin/ffmpegthumbnailer" arguments="-i %in -o %out -s 128 -t 2"/> <buffer size="524288" chunk-size="512" fill-size="1024"/>       </profile>     </profiles>   </transcoding> </config> いじょ
遅まきながら報告。以前に書いた

「IEのWeb ページ ダイアログのウインドウのクラス名」

「んでもってVBAでウインドウハンドルからIEのDOMオブジェクトを得る」

を使って、Excel VBAからIEのWebページダイアログの操作を試みた。(ターゲットとなるIEは6と8)
結果OKだった。

「IEのWeb ページ ダイアログのウインドウのクラス名」を使ってIEのWebページダイアログのウインドウハンドルを得て「んでもってVBAでウインドウハンドルからIEのDOMオブジェクトを得る」を使ってDOM取得しWebページダイアログページへの操作がExcel VBAからできました。

WebページダイアログのHTMLのソースも拾えるし、こりゃ便利だわ

いじょ
ウチにciscoの1812Jがあるのだが、スマホ用のVPNの入り口として使っている。
で、そのためダイアラーインターフェースをデフォルトルートにしてる。
(なんか他にやり方あるのだろうが、わからん)

で、そいつにIX2015をサイト間接続でVPNをIPSECでもう一本張り(グローバルアドレスはお互い固定IP)、外への接続は1812J側にある別のルーター経由で行おうとしていたのだが、1812Jのデフォルトルートがダイヤラーなんでうまく行かない。

で、いろいろ調べていたら1812Jでポリシーベースルーティングと云うのがり別途デフォルトルートっぽいのが設定できそうな雰囲気なので、IX2015との接続で使っているトンネルインターフェースでも適用できるんか試してみたら結局うまく行った。
(実は3日くらいできなくてトンネルにはダメ?といろいろやっいたのだが、結論。アクセスリストが間違ってた...あーあ。気を付けなければ...)

コマンドはこんな感じ、

(デフォルトルートはダイヤラー ip route 0.0.0.0 0.0.0.0 Dialer0)

・アクセスリスト(とりあえず)
access-list 100 permit ip XXX.XXX.XXX.0 0.0.0.255 any (XXXはIX2015側のローカルネットワークアドレス)

・ルートマップ
route-map HOGE permit 10
 match ip address 100
 set ip default next-hop XXX.XXX.XXX.XXX (1812J側の別のルーターへのネクストホップのIP)

・マップをインターフェースに適用
interface Tunnel0
    ・
    ・
 ip policy route-map HOGE
    ・

これでIX2015からVPN経由で1812J側の別ルーターから外にでることができました。

本当にいいのかは謎。自宅での趣味なので良しとしちゃいます。

いじょ

oVirt ISOイメージのUploadは以下のコマンド叩く(ISO-DOMAINストレージはウチの環境ではデフォルトのママなのでOK)

engine-iso-uploader -i <ISOドメイン名> upload <ISOファイル名>

いじょ