freerdp

https://www.freerdp.com/




会社のサーバにリモートデスクトップ接続するまでに、すごく時間がかかる。
(もとから入っているリモートデスクトップ接続アプリを使用)

wiresharkでパケットをキャプチャしたところ、

        ↓キャプチャ開始からの秒数
No.     Time            Source  Destination  Protocol  Length  Info
26      4.761131        client  server       TCP       66      34764 → 3389 [SYN] Seq=0 Win=64202 Len=0 MSS=1366 WS=256 SACK_PERM=1
27      4.788368        server  client       TCP       66      3389 → 34764 [SYN, ACK] Seq=0 Ack=1 Win=64000 Len=0 MSS=1460 WS=1 SACK_PERM=1
28      4.788467        client  server       TCP       54      34764 → 3389 [ACK] Seq=1 Ack=1 Win=131072 Len=0
29      4.789573        client  server       SSL       101     Continuation Data
30      4.825240        server  client       SSL       73      Continuation Data
31      4.864619        client  server       TCP       54      34764 → 3389 [ACK] Seq=48 Ack=20 Win=131072 Len=0
702     94.839317       server  client       TCP       54      3389 → 34764 [RST, ACK] Seq=20 Ack=48 Win=0 Len=0
2963    219.578206      client  server       TCP       66      34871 → 3389 [SYN] Seq=0 Win=64202 Len=0 MSS=1366 WS=256 SACK_PERM=1
2964    219.605669      server  client       TCP       66      3389 → 34871 [SYN, ACK] Seq=0 Ack=1 Win=64000 Len=0 MSS=1460 WS=1 SACK_PERM=1
2965    219.605751      client  server       TCP       54      34871 → 3389 [ACK] Seq=1 Ack=1 Win=131072 Len=0
2966    219.606893      client  server       TLSv1.2   101     Ignored Unknown Record
2967    219.641686      server  client       TLSv1.2   73      Ignored Unknown Record
2968    219.646667      client  server       TLSv1.2   232     Client Hello
...
...

クライアントがSSLで通信するとつながらなくて、その後TLSv1.2で通信するとサーバに接続できるように見える。
いろいろ設定変更してSSL接続しないよう試すが、どうしてもSSLでつなぎにいってしまう。。。


freerdp(linux版)をインストールしてつなぎにいくと、すんなり接続できた。

        ↓キャプチャ開始からの秒数
No.     Time            Source  Destination  Protocol  Length  Info
568     64.803346       client  server       TCP       66      59979 → 3389 [SYN] Seq=0 Win=64202 Len=0 MSS=1366 WS=256 SACK_PERM=1
569     64.838638       server  client       TCP       66      3389 → 59979 [SYN, ACK] Seq=0 Ack=1 Win=64000 Len=0 MSS=1460 WS=1 SACK_PERM=1
570     64.838754       client  server       TCP       54      59979 → 3389 [ACK] Seq=1 Ack=1 Win=131072 Len=0
571     64.839638       client  server       TLSv1.2   98      Ignored Unknown Record
572     64.887277       server  client       TLSv1.2   73      Ignored Unknown Record
573     64.904253       client  server       TLSv1.2   365     Client Hello
574     64.942927       server  client       TLSv1.2   1229    Server Hello, Certificate, Server Key Exchange, Server Hello Done
575     64.944605       client  server       TLSv1.2   180     Client Key Exchange, Change Cipher Spec, Encrypted Handshake Message
576     64.981094       server  client       TLSv1.2   105     Change Cipher Spec, Encrypted Handshake Message
577     65.021892       client  server       TCP       54      59979 → 3389 [ACK] Seq=482 Ack=1246 Win=129792 Len=0
...
...

rubyにおける標準入力、後方参照の書き方

["aaa"]
["bbb"]

から [""] を取り除く


Perlの場合
(strip.pl)

#!/usr/bin/env perl

while(<>){
  chomp;
  s/\[\"(\S+)\"\]/$1/;
  print $_,"\n";
}
$ cat a.txt | ./strip.pl 
aaa
bbb


Rubyの場合
(strip.rb)

#!/usr/bin/env ruby

STDIN.each do |line|
  line.gsub!(/\[\"(\S+)\"\]/,'\1')
  puts line
end
$ cat a.txt | ./strip.rb 
aaa
bbb

バッハ:チェンバロ協奏曲集 トン・コープマン

バッハ:チェンバロ協奏曲集

バッハ:チェンバロ協奏曲集


トラック タイトル 作曲者
1 Bach: Harpsichord Concerto In D Minor, BWV 1052 - 1. Allegro Johann Sebastian Bach
2 Bach: Harpsichord Concerto In D Minor, BWV 1052 - 2. Adagio Johann Sebastian Bach
3 Bach: Harpsichord Concerto In D Minor, BWV 1052 - 3. Allegro Johann Sebastian Bach
4 Bach: Harpsichord Concerto In D, BWV 1054 - 1. Allegro Johann Sebastian Bach
5 Bach: Harpsichord Concerto In D, BWV 1054 - 2. Adagio E Piano Sempre Johann Sebastian Bach
6 Bach: Harpsichord Concerto In D, BWV 1054 - 3. Allegro Johann Sebastian Bach
7 Concerto for harpsichord in A major BWV1055 I. Allegro J.S.バッハ
8 Concerto for harpsichord in A major BWV1055 II. Larghetto J.S.バッハ
9 Concerto for harpsichord in A major BWV1055 III. Allegro ma non tanto J.S.バッハ
10 Bach: Harpsichord Concerto In F Minor, BWV 1056 - 1. Allegro Johann Sebastian Bach
11 Bach: Harpsichord Concerto In F Minor, BWV 1056 - 2. Largo Johann Sebastian Bach
12 Bach: Harpsichord Concerto In F Minor, BWV 1056 - 3. Presto Johann Sebastian Bach
13 Bach: Concerto For 4 Harpsichords & Strings In A Minor, BWV 1065 - 1. (Without Tempo Indication) Johann Sebastian Bach
14 Bach: Concerto For 4 Harpsichords & Strings In A Minor, BWV 1065 - 2. Largo Johann Sebastian Bach
15 Bach: Concerto For 4 Harpsichords & Strings In A Minor, BWV 1065 - 3. Allegro Johann Sebastian Bach