努力したWiki

推敲の足りないメモ書き多数

ユーザ用ツール

サイト用ツール


documents:olddiary:2015:201512

←201511^start|目次^..:2016:201601→

2015-12 日記コピー

2015-12-15 SSL適用してみた

[www] Let's Encryptの証明書でSSL対応してみた。

Let's Encrypt - Free SSL/TLS Certificates

Let's Encrypt 総合ポータル

Let's Encrypt の使い方

公開ベータプログラム(Public Beta Program)が始まったよと教わったので、証明書の取得と hgotoh.jp をSSL対応してみました。

証明書取得ツールの扱いでちょっと手間取りましたが、わかってしまえばあとはすんなり。

取得ツール実行時はポート80番が空いてなきゃいけないので、Webサーバを一度停止してrootで操作する必要があります。

ドメイン所有の確認方法が、Let's Encryptのサーバから指定のドメイン(のポート80番)でListenしている取得ツール(HTTPサーバとして待ち受けしています)にアクセスできるか、で判断しているためですね。

なので、サーバに無停止が必要な場合は残念ながら使えませんし、別サーバで代替取得もできません。

それと、有効期間が90日の証明書なので定期的な更新が必要になります。Let's Encryptでは60日単位での更新を推奨していますね。更新もツールで可能との事なのですが、これを試すのはまだ先になります。

2015-12-21 NicoFox 1.0b6preのインストール

[www] NicoFox 1.0b6pre の導入手順

NicoFox 1.0b6pre をFirefoxのアドオンのファイル xpi の形式にする方法を尋ねられたので調べた結果のメモ書きです。

少なくとも私に尋ねてきた人の環境に関してはこのメモの手順でうまく動作しているようです。

概要

https://addons.mozilla.org で公開されているNicoFoxのバージョンは1.0b5.1-signedです。

しかしこのバージョンには問題があり、これを修正したNicoFox 1.0b6pre がGitHubに公開されています。そして残念ながら https://addons.mozilla.org に公開されていません。

自分でGitHubのリポジトリからダウンロードしてxpiファイルを構築する必要があります。

ファイルのダウンロードと内容確認

某掲示板に情報があるだろうと思ったらあんのじょう。

http://anago.2ch.net/test/read.cgi/software/1348361830/l50

http://anago.2ch.net/test/read.cgi/software/1426084445/117

そして https://github.com/littlebtc/nicofox の情報を見つけました。ここから NicoFox 1.0b6pre をダウンロードします。

私は“Download ZIP”ボタンを押して nicofox-master.zip を取得しました。

次に取得したnicofox-master.zipを展開します。

zipファイルに含まれているシェルスクリプト build.sh を実行すればnocofox.xpiが作成されるのですが、Windowsしかない人はUnix実行環境を作るのも大変ですので、ちょっと内容を眺めてみました。

見た感じだと以下のフォルダを一番低い圧縮レベルで nicofox.xpi にまとめているようです。

  • contentフォルダ
  • skinフォルダ
  • componentsフォルダ
  • modulesフォルダ
  • defaultsフォルダ
  • defaults/preferencesフォルダ
  • localeフォルダ
  • install.rdfファイル
  • chrome.manifestファイル
  • LICENSE.mdファイル

7-zipで一番低い圧縮レベルのアーカイブに作り直す

Windowsの標準機能ではZIPアーカイブの圧縮レベルを制御できないので、7-ZIP を利用することにします。

7-zipをインストールしたら、コマンドプロンプトを起動し、nicofox-master.zip を展開したフォルダにカレントフォルダを移動します。

以下は H:\nicofox\nicofox-master にカレントフォルダを移動して、C:\Program Files\7-Zip にインストールされた 7z.exe を起動した例です。

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
 
C:\Users\user01>cd /D H:\nicofox\nicofox-master
 
H:\nicofox\nicofox-master>"C:\Program Files\7-zip\7z"
 
7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
 
Usage: 7z  [...]  [...]
       [<@listfiles...>]
 

  a: Add files to archive
  b: Benchmark
  d: Delete files from archive
  e: Extract files from archive (without using directory names)
  l: List contents of archive
  t: Test integrity of archive
  u: Update files to archive
  x: eXtract files with full paths

  -ai[r[-|0]]{@listfile|!wildcard}: Include archives
  -ax[r[-|0]]{@listfile|!wildcard}: eXclude archives
  -bd: Disable percentage indicator
  -i[r[-|0]]{@listfile|!wildcard}: Include filenames
  -m{Parameters}: set compression Method
  -o{Directory}: set Output directory
  -p{Password}: set Password
  -r[-|0]: Recurse subdirectories
  -scs{UTF-8 | WIN | DOS}: set charset for list files
  -sfx[{name}]: Create SFX archive
  -si[{name}]: read data from stdin
  -slt: show technical information for l (List) command
  -so: write data to stdout
  -ssc[-]: set sensitive case mode
  -ssw: compress shared files
  -t{Type}: Set type of archive
  -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName]: Update options
  -v{Size}[b|k|m|g]: Create volumes
  -w[{path}]: assign Work directory. Empty path means a temporary directory
  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames
  -y: assume Yes on all queries
 
H:\nicofox\nicofox-master>

Build.shで使っているzipコマンドのオプション確認

build.sh に記載のあったzip コマンドラインは“zip -r1DX ../nicofox.xpi *”で、

  1. -r : サブフォルダもアーカイブ対象
  2. -1 : 高速圧縮(一番低い圧縮率)
  3. -D : ルートをまとめるディレクトリを作らない
  4. -X : ファイルの属性はアーカイブしない
  5. 出力先は ../nicofox.xpi

の意になります。

7-zipコマンドのオプション確認

これに対応する7zコマンドのコマンドラインは“7z a -r -tzip -mx=1 ..\nicofox.xpi *”で、

  1. a : アーカイブ作成
  2. -r : サブフォルダもアーカイブ対象
  3. -tzip : ZIP形式
  4. -mx=1 : 高速圧縮(一番低い圧縮率)
  5. 出力先は ..\nicofox.xpi

の意になります。

圧縮実行

Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
 
C:\Users\user01>cd /D H:\nicofox\nicofox-master
H:\nicofox\nicofox-master>"C:\Program Files\7-zip\7z" a -r -tzip -mx=1 ..\nicofox.xpi *
 
7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18
Scanning
 
Creating archive ..\nicofox.xpi
 
Compressing  .gitignore
Compressing  build.sh
Compressing  chrome.manifest
Compressing  components\bootstrap.js
Compressing  components\nicowatcher.js
Compressing  components\vacuumParticipant.js
Compressing  content\customizeToolbarOverlay.xul
Compressing  content\firefoxOverlay.xul
Compressing  content\nicofoxPlayer.js
Compressing  content\nicofoxPlayer.swf
Compressing  content\nicofoxPlayer.xul
Compressing  content\overlay.js
Compressing  content\preferences.xul
Compressing  content\prefPaneDownload.js
Compressing  content\prefPaneDownload.xul
Compressing  content\prefPanePage.xul
Compressing  content\prefPanePlayer.js
Compressing  content\prefPanePlayer.xul
Compressing  content\smilefoxPanel.js
Compressing  content\smilefoxPanel.xml
Compressing  content\smilefoxPanel.xul
Compressing  defaults\preferences\nicofox.js
Compressing  install.rdf
Compressing  LICENSE.md
Compressing  locale\en-US\nicofox.dtd
Compressing  locale\en-US\nicofox.properties
Compressing  locale\en-US\prefwindow.dtd
Compressing  locale\en-US\smilefox.dtd
Compressing  locale\ja\nicofox.dtd
Compressing  locale\ja\nicofox.properties
Compressing  locale\ja\prefwindow.dtd
Compressing  locale\ja\smilefox.dtd
Compressing  locale\zh-CN\nicofox.dtd
Compressing  locale\zh-CN\nicofox.properties
Compressing  locale\zh-CN\prefwindow.dtd
Compressing  locale\zh-CN\smilefox.dtd
Compressing  locale\zh-TW\nicofox.dtd
Compressing  locale\zh-TW\nicofox.properties
Compressing  locale\zh-TW\prefwindow.dtd
Compressing  locale\zh-TW\smilefox.dtd
Compressing  modules\Core.jsm
Compressing  modules\DownloadManager.jsm
Compressing  modules\DownloadUtils.jsm
Compressing  modules\FileBundle.jsm
Compressing  modules\Network.jsm
Compressing  modules\NicoLogin.jsm
Compressing  modules\ProcessRunner.jsm
Compressing  modules\VideoInfoReader.jsm
Compressing  modules\When.jsm
Compressing  README.md
Compressing  skin\close.png
Compressing  skin\cross.png
Compressing  skin\folder_go.png
Compressing  skin\lock_break.png
Compressing  skin\logo.png
Compressing  skin\logo_16_sprite.png
Compressing  skin\logo_24.png
Compressing  skin\options_sprite.png
Compressing  skin\smilefox.css
Compressing  skin\thumb_missing.png
Compressing  skin\toolbar.css
Compressing  skin\toolbarLinux.css
Compressing  skin\toolbarMac.css
Compressing  skin\toolbar_sprite.png
Compressing  skin\wrench.png
 
Everything is Ok
 
H:\nicofox\nicofox-master>

出来上がったnicofox.xpiをFirefoxにD&Dすればインストールできます。 build.shに書かれていない余分なファイルもアーカイブされてしまっていますが、とりあえずは動くようです。

気になる人は build.sh を読んでバッチファイルを作りましょう

build.shに従い、buildフォルダを作りその中に必要なファイル、フォルダをコピーしてxpiファイルを作成してください。

もし「このアドオンは壊れているため、インストールできませんでした」と出てインストールできない場合は、

FirefoxのURL欄に about:config を打ち込み、設定名 xpinstall.signatures.required の値を false にしてください。

次のバージョン(Firefox 44)から署名のないアドオンは使えなくなるかも

2015-12-26 うちのアプリケーションは.NET Framework 4.52.配下でも動作はした

[www] BGWAIT、PARASTARTコマンドは.NET Framework 4.5.2配下でも動作しました

バッチファイルで使うWAITコマンド的なもの

複数プログラムを指定できるSTARTコマンド

こそっと使ってる職場環境で問題なく動いたのを確認しました。

ついでにVisual Studio Community 2015でソースをコンパイルしてみましたが、ソースレベルでの問題はなさげです。

2015-12-31 WindowsのWOL&リモート接続

[雑記] Windows10でWOL

聞かれたので。

前はWindows10でWOLできないという話が流れていましたが、少なくとも私の環境だと動作しているのでそのメモ書き。実家に帰省した際にもリモートで起動、ノートPCからリモートデスクトップ接続できました。

OSは Windows10 Pro バージョン1511 OSビルド 10586.36

NIC は蟹さんマークの Realtek RTL8168D PCIe GBE Family Controller

普段はコマンドプロンプトで shutdown /h を実行するか、スリープでPCを落としておき、wolコマンドでマジックパケットを飛ばして起動させています。

デバイスマネージャでWindows機NICのプロパティを変更しておきます。

使用するソフトウエア

検索エンジンで Windows WOL あたりをキーワードに調べてください。

また、インターネット経由でルータの後ろにいるマシンにWOLの為のマジックパケットを飛ばすには、少なくともルータがマジックパケットを受け入れる事が出来なければなりません。

私の場合は、低電力消費の常時稼働PC(FreeBSD)が部屋にあるので、このPCにSSHで接続、ツール Tool to wake up Wake-On-LAN compliant computers(/usr/ports/net/wol)でターゲットPCが存在するセグメントにマジックパケットを送信しています。

また常時稼働PCからターゲットPCの3389ポートへ接続するようSSHのトンネル設定済みなので、ターゲットPCが起動さえすればリモートのPCからターゲットPCへの接続ができます。

SSHクライアントには Puttyごった煮版 を使いました。

documents/olddiary/2015/201512.txt · 最終更新: 2024/04/14 11:23 by k896951

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki