やるきなし

2023/05/24 23:09 / お名前.com 共用サーバーSD (SDプラン)からRSプランに移行

共用サーバーSD (SD-11プラン; 年払い12,936円(税込))はいろいろ不便で,別プロジェクトでRSプラン(初回は若干割引あるけどコストは同じ)を利用したこともあったので,RSプランに移行.移行に関する説明はここにある.いろいろ便利になった.

Related articles

2023/03/28 19:42 / RTL-SDR で FM を聞く(ffmpeg と pulseaudio メモ)

手元に https://www.amazon.co.jp/dp/B00VDSFXDC/ の RTL-SDR があるので,ひとまず FM を聞いてみる.何故かリモート計算機に RTL-SDR を接続してあるので,リモートでごにょごにょするメモ.

リモートサーバ(hoge; 実際には手元)で起動している pulseaudio にデータを送って,それで聞く.

% export PULSE_SERVER=hoge
% sudo rtl_fm -f 80.4M -Mwbfm | ffplay - -f s16le -nodisp -ar 32000

環境変数 PULSE_SERVER については こちら 参照.なお,この場合 hoge 側で TCP/IP で受けられる設定が必要.

あるいは,nc で送って,ただし AAC で圧縮する.

@hoge
% nc -l -p 2000 | ffplay - -f aac
@RTL-SDR
% sudo rtl_fm -f 80.4M -Mwbfm | ffmpeg -f s16le -ar 32000 -i - -f adts -y /dev/stdout | nc hoge 2000

先に hoge 側で nc を起動しておく必要があるし,接続が途絶えると nc の process が終了する.

なお,-Mwbfm-M fm -s 170k -o 4 -A fast -r 32k -l 0 -E deemp と同じで,ffmpegffplay-ar 32000 はこれ由来のオーディオサンプリングレート.

2023/03/16 13:48 / Amazon からの注文確定のメールを MHonArc が Nested start tags で拒否る

Amazon からの注文確定のメールを MHonArc が Nested start tags で拒否る.以下.

Warning: Rejecting Invalid HTML: Nested start tags
         Message-Id: <xxxxxxxxxxxxxxxx-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx-xxxxxx@us-west-x.amazonses.com>

この Warning を吐くコードは以下で,

[/usr/share/mhonarc/mhtxthtml.pl]
    # Bug-32013 (CVE-2010-4524): Invalid tags cause immediate rejection.
    # Bug-32014 (CVE-2010-1677): Prevents DoS if massively nested.
    my $allowcom = $args =~ /\ballowcomments\b/i;
    strip_comments($fields, $data)  unless $allowcom;
    if ($$data =~ /<[^>]*</) {
      # XXX: This will reject HTML that includes a '<' char in a
      #      comment declaration if allowcomments is enabled.
      return bad_html_reject($fields, "Nested start tags");
    }

/<[^>]*</ の正規表現で引っかかっている箇所は以下.確かに Amazon が悪い...

    <!-- This is called in a loop from the MAIN template
## #foreach($orderId in $orderIds)--> 
    <!--Images--> 
    <!--ROW 4--> 
    <tr <td="" style="font-family: Arial, sans-serif !important">   
    </tr> 
    <!--Checks if the buyerName and groupName is null or empty--> 
    <tr style="font-family: Arial, sans-serif !important"> 
     <td width="600" valign="top" style="font-family: Arial, sans-serif !important;border-collapse: collapse"> 
      <!--Order Details Table--> 
      <table style="border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;font-family: Arial, sans-serif !important"> 

CVE割当があって,

ちょっと嫌だけど,MHonArc に掛けるメールはフィルタ済み(特定の送信元; 発注情報共有目的)なので,bad_html_reject の行をコメントアウトすることにした.

Related articles

2023/02/25 18:56 / シンプルパソコンデスク検討

古いデスク(横長; たぶん安物)の真ん中が少々下がってきてディスプレイが斜めになるので,検討.

ちなみに別拠点ではサンワダイレクトの古い 100-DESK080M を利用していて,70D x 160W x 70H cm とかなり広いのだけど重量も相当で(24 kg),かつモニターアームを取り付けるにはフレームがゴツすぎたはず.100Wの同型だと 17 kgなので,それに比べると70Dと60Dの違いを考慮しても最近のものは少し軽くなっている様子.

Related articles

2023/02/25 13:10 / http と https,www. を付ける付けないの正規化(Canonicalization)

Apache mod_rewrite を使って http は https に,example.org は www.example.org に転送する設定.以下.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^/?(.*) https://www.%{HTTP_HOST}/$1 [R=301,L,NE]
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R=301,L,NE]
</IfModule>

Related articles