zu Hause, nach Hause, im Fluge, im Laufe, am Tage …
このように3格支配の前置詞と男性・中性名詞の組み合わせで名詞に語尾-eがつく時があります。
名詞単体で用いられる場合も-eがついている場合がありますね。
[Nhd] mögenを「~が好きだ」の用法で使う注意点
(私の昔のNoteからそのまま引っ越してきた記事です。)
mögenを「~が好きだ」の意味(つまり本動詞:Vollverbとして用いる際)で一緒に用いれる語というのは基本的に「名詞」ですが、この名詞は、動詞がそのまま名詞化した(動詞と同じ語形の)名詞「schwimmen > Schwimmen, tanzen > Tanzen」や、動詞の不定形と結ぶことはできません。
[GCP] Cloud Shellのベンチマーク
Google Cloud Platformに関する作業などがブラウザから簡単に行うことができるCloud Shell。
外出先等でちょっと用事があるときに非常に便利ですよね。
今回はこのCloud ShellのベンチマークをUnixBenchで採ってみました。
ところで、Cloud ShellはGCEのg1-smallらしいです。(ブースト時はn1-standard-1)
前はg1-smallではなくf1-microだった気がするんですけど、気のせいですかね?
特徴
・Compute Engine での一時的な仮想マシン インスタンス
・ウェブブラウザからインスタンスへのコマンドライン アクセス
・組み込みのコードエディタ ベータ版
・5 GB の永続ディスク ストレージ
・プレインストールされた Google Cloud SDK とその他のツール
・Java、Go、Python、Node.js、PHP、Ruby、.NET への言語対応
・ウェブ プレビュー機能
・GCP Console のプロジェクトとリソースに対するアクセスのビルトイン承認
https://cloud.google.com/shell/docs/features
通常はCloud Shellを開いた時、g1-smallがプロビジョニングされます。
ブーストモードを有効にした場合はn1-standard-1としてプロビジョニングされます。
サーバースペック
g1-small
0.5 基の仮想 CPU と 1.70 GB のメモリを備え、共有物理コアを基盤とした共有コア マシンタイプ。
https://cloud.google.com/compute/docs/machine-types
:~$ free -m
total used free shared buff/cache available
Mem: 1695 362 463 0 869 1180
Swap: 0 0 0
:~$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
overlay overlay 31G 22G 8.4G 73% /
tmpfs tmpfs 848M 0 848M 0% /dev
tmpfs tmpfs 848M 0 848M 0% /sys/fs/cgroup
/dev/sda1 ext4 31G 22G 8.4G 73% /root
/dev/sdb1 ext4 4.8G 12M 4.6G 1% /home
overlayfs overlay 1.0M 108K 916K 11% /etc/ssh/keys
tmpfs tmpfs 848M 720K 847M 1% /run/metrics
shm tmpfs 64M 0 64M 0% /dev/shm
overlayfs overlay 1.0M 108K 916K 11% /etc/ssh/ssh_host_dsa_key
tmpfs tmpfs 848M 0 848M 0% /run/google/devshell
n1-standard-1
1 基の仮想 CPU と 3.75 GB のメモリを備えた標準マシンタイプ。
https://cloud.google.com/compute/docs/machine-types
~$ free -m
total used free shared buff/cache available
Mem: 3698 352 2171 0 1175 3119
Swap: 0 0 0
:~$ df -Th
Filesystem Type Size Used Avail Use% Mounted on
overlay overlay 31G 23G 8.3G 73% /
tmpfs tmpfs 1.9G 0 1.9G 0% /dev
tmpfs tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda1 ext4 31G 23G 8.3G 73% /root
/dev/sdb1 ext4 4.8G 12M 4.6G 1% /home
overlayfs overlay 1.0M 108K 916K 11% /etc/ssh/keys
tmpfs tmpfs 1.9G 676K 1.9G 1% /run/metrics
shm tmpfs 64M 0 64M 0% /dev/shm
overlayfs overlay 1.0M 108K 916K 11% /etc/ssh/ssh_host_rsa_key
tmpfs tmpfs 1.9G 0 1.9G 0% /run/google/devshell
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Xeon(R) CPU @ 2.50GHz
stepping : 4
microcode : 0x1
cpu MHz : 2500.000
cache size : 30720 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt aes xsave avx f16c rdrand hypervisor lahf_lm pti fsgsbase tsc_adjust smep erms xsaveopt
bugs : cpu_meltdown spectre_v1 spectre_v2 l1tf
bogomips : 5000.00
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management:
UnixBench
通常時
通常時のUnixBench。
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: cs-6000-devshell-vm-xxxxxx: GNU/Linux
OS: GNU/Linux -- 4.14.33+ -- #1 SMP Sat Aug 11 08:05:16 PDT 2018
Machine: x86_64 (unknown)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) CPU @ 2.50GHz (5000.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
00:35:02 up 15 min, 2 users, load average: 0.14, 0.33, 0.20; runlevel
------------------------------------------------------------------------
Benchmark Run: Mon Aug 20 2018 00:35:02 - 01:04:05
1 CPU in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 29138732.1 lps (10.0 s, 7 samples)
Double-Precision Whetstone 2942.8 MWIPS (13.0 s, 7 samples)
Execl Throughput 1947.3 lps (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 200275.9 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 56955.0 KBps (30.1 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 538326.0 KBps (30.0 s, 2 samples)
Pipe Throughput 310676.5 lps (10.0 s, 7 samples)
Pipe-based Context Switching 79299.3 lps (10.0 s, 7 samples)
Process Creation 5724.0 lps (30.1 s, 2 samples)
Shell Scripts (1 concurrent) 3252.4 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 397.4 lpm (60.2 s, 2 samples)
System Call Overhead 180235.1 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 29138732.1 2496.9
Double-Precision Whetstone 55.0 2942.8 535.1
Execl Throughput 43.0 1947.3 452.9
File Copy 1024 bufsize 2000 maxblocks 3960.0 200275.9 505.7
File Copy 256 bufsize 500 maxblocks 1655.0 56955.0 344.1
File Copy 4096 bufsize 8000 maxblocks 5800.0 538326.0 928.1
Pipe Throughput 12440.0 310676.5 249.7
Pipe-based Context Switching 4000.0 79299.3 198.2
Process Creation 126.0 5724.0 454.3
Shell Scripts (1 concurrent) 42.4 3252.4 767.1
Shell Scripts (8 concurrent) 6.0 397.4 662.3
System Call Overhead 15000.0 180235.1 120.2
========
System Benchmarks Index Score 475.7
ブーストモード
ブーストモードを有効にしたときのUnixBench。
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: cs-6000-devshell-vm-xxxxx: GNU/Linux
OS: GNU/Linux -- 4.14.33+ -- #1 SMP Sat Aug 11 08:05:16 PDT 2018
Machine: x86_64 (unknown)
Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
CPU 0: Intel(R) Xeon(R) CPU @ 2.50GHz (5000.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
01:12:24 up 10:31, 2 users, load average: 0.26, 0.10, 0.03; runlevel
------------------------------------------------------------------------
Benchmark Run: Mon Aug 20 2018 01:12:24 - 01:40:32
1 CPU in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 30024941.0 lps (10.0 s, 7 samples)
Double-Precision Whetstone 3797.8 MWIPS (9.8 s, 7 samples)
Execl Throughput 3630.8 lps (29.5 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 332742.6 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 90811.0 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 903244.8 KBps (30.0 s, 2 samples)
Pipe Throughput 487114.9 lps (10.0 s, 7 samples)
Pipe-based Context Switching 115958.0 lps (10.0 s, 7 samples)
Process Creation 10922.9 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 6742.0 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 838.9 lpm (60.0 s, 2 samples)
System Call Overhead 276681.1 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 30024941.0 2572.8
Double-Precision Whetstone 55.0 3797.8 690.5
Execl Throughput 43.0 3630.8 844.4
File Copy 1024 bufsize 2000 maxblocks 3960.0 332742.6 840.3
File Copy 256 bufsize 500 maxblocks 1655.0 90811.0 548.7
File Copy 4096 bufsize 8000 maxblocks 5800.0 903244.8 1557.3
Pipe Throughput 12440.0 487114.9 391.6
Pipe-based Context Switching 4000.0 115958.0 289.9
Process Creation 126.0 10922.9 866.9
Shell Scripts (1 concurrent) 42.4 6742.0 1590.1
Shell Scripts (8 concurrent) 6.0 838.9 1398.1
System Call Overhead 15000.0 276681.1 184.5
========
System Benchmarks Index Score 770.0
Index Score
通常時とブーストモードで3回UnixBenchを走らせた結果デス。
通常時 | ブーストモード | g1-small | n1-standard-1 | f1-micro | |
---|---|---|---|---|---|
1 | 475.7 | 770.0 | 847.7 | 1313.6 | 152.1 |
2 | 483.0 | 768.8 | – | – | – |
3 | 476.8 | 769.0 | – | – | – |
おまけ
比較のため、f1-micro, g1-small, n1-standard-1のUnixBenchも採ったので載せておきます。
g1-small
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: g1small: GNU/Linux
OS: GNU/Linux -- 4.9.0-7-amd64 -- #1 SMP Debian 4.9.110-3+deb9u2 (2018-08-13)
Machine: x86_64 (unknown)
Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
CPU 0: Intel(R) Xeon(R) CPU @ 2.30GHz (4600.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
01:53:20 up 3 min, 1 user, load average: 0.08, 0.04, 0.01; runlevel Aug
------------------------------------------------------------------------
Benchmark Run: Mon Aug 20 2018 01:53:20 - 02:22:12
1 CPU in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 30951363.0 lps (10.0 s, 7 samples)
Double-Precision Whetstone 3507.5 MWIPS (12.2 s, 7 samples)
Execl Throughput 2996.6 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 458268.7 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 133952.0 KBps (30.1 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1218898.4 KBps (30.0 s, 2 samples)
Pipe Throughput 776309.5 lps (10.0 s, 7 samples)
Pipe-based Context Switching 135166.1 lps (10.0 s, 7 samples)
Process Creation 8439.8 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 4922.6 lpm (60.1 s, 2 samples)
Shell Scripts (8 concurrent) 617.5 lpm (60.1 s, 2 samples)
System Call Overhead 527722.7 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 30951363.0 2652.2
Double-Precision Whetstone 55.0 3507.5 637.7
Execl Throughput 43.0 2996.6 696.9
File Copy 1024 bufsize 2000 maxblocks 3960.0 458268.7 1157.2
File Copy 256 bufsize 500 maxblocks 1655.0 133952.0 809.4
File Copy 4096 bufsize 8000 maxblocks 5800.0 1218898.4 2101.5
Pipe Throughput 12440.0 776309.5 624.0
Pipe-based Context Switching 4000.0 135166.1 337.9
Process Creation 126.0 8439.8 669.8
Shell Scripts (1 concurrent) 42.4 4922.6 1161.0
Shell Scripts (8 concurrent) 6.0 617.5 1029.2
System Call Overhead 15000.0 527722.7 351.8
========
System Benchmarks Index Score 847.7
n1-standard-1
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: n1standard1: GNU/Linux
OS: GNU/Linux -- 4.9.0-7-amd64 -- #1 SMP Debian 4.9.110-3+deb9u2 (2018-08-13)
Machine: x86_64 (unknown)
Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
CPU 0: Intel(R) Xeon(R) CPU @ 2.30GHz (4600.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
01:53:04 up 3 min, 1 user, load average: 0.19, 0.07, 0.02; runlevel Aug
------------------------------------------------------------------------
Benchmark Run: Mon Aug 20 2018 01:53:04 - 02:21:11
1 CPU in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 31460987.6 lps (10.0 s, 7 samples)
Double-Precision Whetstone 4176.3 MWIPS (9.9 s, 7 samples)
Execl Throughput 5369.1 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 735957.9 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 209307.4 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1854594.5 KBps (30.0 s, 2 samples)
Pipe Throughput 1130884.6 lps (10.0 s, 7 samples)
Pipe-based Context Switching 208971.2 lps (10.0 s, 7 samples)
Process Creation 15182.0 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 9874.3 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 1206.0 lpm (60.0 s, 2 samples)
System Call Overhead 769258.9 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 31460987.6 2695.9
Double-Precision Whetstone 55.0 4176.3 759.3
Execl Throughput 43.0 5369.1 1248.6
File Copy 1024 bufsize 2000 maxblocks 3960.0 735957.9 1858.5
File Copy 256 bufsize 500 maxblocks 1655.0 209307.4 1264.7
File Copy 4096 bufsize 8000 maxblocks 5800.0 1854594.5 3197.6
Pipe Throughput 12440.0 1130884.6 909.1
Pipe-based Context Switching 4000.0 208971.2 522.4
Process Creation 126.0 15182.0 1204.9
Shell Scripts (1 concurrent) 42.4 9874.3 2328.8
Shell Scripts (8 concurrent) 6.0 1206.0 2010.1
System Call Overhead 15000.0 769258.9 512.8
========
System Benchmarks Index Score 1313.6
f1-micro
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: f1micro: GNU/Linux
OS: GNU/Linux -- 4.9.0-7-amd64 -- #1 SMP Debian 4.9.110-3+deb9u2 (2018-08-13)
Machine: x86_64 (unknown)
Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
CPU 0: Intel(R) Xeon(R) CPU @ 2.30GHz (4600.0 bogomips)
Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
01:52:55 up 2 min, 1 user, load average: 0.22, 0.10, 0.03; runlevel Aug
------------------------------------------------------------------------
Benchmark Run: Mon Aug 20 2018 01:52:55 - 02:23:43
1 CPU in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 17570154.4 lps (10.1 s, 7 samples)
Double-Precision Whetstone 838.1 MWIPS (28.3 s, 7 samples)
Execl Throughput 1218.6 lps (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 161377.9 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 39812.8 KBps (30.1 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 330861.9 KBps (30.0 s, 2 samples)
Pipe Throughput 340018.4 lps (10.0 s, 7 samples)
Pipe-based Context Switching 62298.5 lps (10.0 s, 7 samples)
Process Creation 3822.6 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 2085.7 lpm (60.1 s, 2 samples)
Shell Scripts (8 concurrent) 288.9 lpm (60.2 s, 2 samples)
System Call Overhead 228185.5 lps (10.1 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 17570154.4 1505.6
Double-Precision Whetstone 55.0 838.1 152.4
Execl Throughput 43.0 1218.6 283.4
File Copy 1024 bufsize 2000 maxblocks 3960.0 161377.9 407.5
File Copy 256 bufsize 500 maxblocks 1655.0 39812.8 240.6
File Copy 4096 bufsize 8000 maxblocks 5800.0 330861.9 570.5
Pipe Throughput 12440.0 340018.4 273.3
Pipe-based Context Switching 4000.0 62298.5 155.7
Process Creation 126.0 3822.6 303.4
Shell Scripts (1 concurrent) 42.4 2085.7 491.9
Shell Scripts (8 concurrent) 6.0 288.9 481.4
System Call Overhead 15000.0 228185.5 152.1
========
System Benchmarks Index Score 330.4
最後に
Index Scoreをざっと見ると、Cloud Shellはg1-smallがプロビジョニングされているとは言えだいぶ制限されているように見えます。
通常時はf1-microより少しいいぐらいで、ブースト時にg1-small相当のような感じでしょうか。
Cloud Shellは無料で使えるので勿論十分すぎるといえば十分すぎますね。
ドイツ語の品詞の種類
ドイツ語の品詞の種類って全部で11種類(ないしは10種類)しかないんです。
分詞は品詞ではない、としている人や本などもあるのでどこかでは、10種類と書いてる場合もあるかもしれないです。
否定詞、心態詞等の~詞ってなってるのは全部品詞と思っている方も微レ存でおられるかもしれません。多分。
Wortart(Kurzwort) | Wortart2 | 品詞名 |
---|---|---|
r. Artikel (Art.) | Geschlechtswort | 冠詞 |
s. Substantiv (Subst., Sub.) | Hauptwort | 名詞 |
s. Verb | Zeitwort usw. | 動詞 |
s. Adjektiv (Adj.) | Eigenschaftswort | 形容詞 |
s. Adverb (Adv.) | Umstandswort | 副詞 |
s. Numerale (Num.) | Zahlwort | 数詞 |
s. Pronomen (Pro.) | Fürwort | 代名詞 |
e. Präposition (Prä.) | Verhältniswort | 前置詞 |
e. Konjunktion (Konj.) | Bindewort | 接続詞 |
e. Interjenktion | Ausrufewort | 間投詞 |
s. Partizip (Part.) | Mittelwort | 分詞 |
[Python] CliでPastebin.comに手軽にペーストするやつ
サーバーでゴニョゴニョしている時に、あぁこれPastebin.comに簡単に上げれたら楽なのに…って思ったのでpythonで簡単に上げるスクリプトを書きました。
引数処理はdocopt使えばよかった…
Python3以上対応です。
Githubに置いてます。
https://github.com/ir1s-work/easy_to_paste
10行目のdev_keyはhttps://pastebin.com/apiにある自身のUnique Developer API Keyを入れてください。
-l オプションを抜くとゲストでペーストされます。
続きを読む
[Debian] gogsの導入とSSL化
09/11/2018 GogsのURLを修正しました。
Google Cloud Platformで無料枠になっていたf1-microの用途に悩んでいたのですが、おひとり様gitサーバーとして使ってみよう、と天啓が下りました。
GitHubのようなOSSで有名なのはGitLabですが、f1-microのスペックでは非常に厳しいです。
(推奨環境がCPU 2コア、メモリ4GB)
他に何かないかなと探してみるとGitBucketやらが出てきましたが、その中でGogsが非常に軽いと聞き、使ってみることにしました。
f1-microの環境は、
f1-micro(vCPU x 1、メモリ 0.6 GB)、
us-west1-c、
HTTP, HTTPSトラフィックの許可、
30GBの標準の永続ディスク、
また、独自ドメインで運用したいのでネットワークに静的 IP アドレスを割り当てています。
続きを読む
[Kusanagi] プラグインの更新や削除ができない
KUSANAGIのWordPressを使用していると、プラグインの更新/削除ができない時があります。
こんな感じのエラーですね。
所有者やグループをwww-data, nginxに変えたりパーミッションを変えたりしても更新/削除がどうにもできませんでした。
そこで所有者とグループをkusanagiに戻してパーミッションを775にしてみると更新/削除ができるようになりました。
よかったよかった。
$ sudo chown kusanagi.kusanagi -R wp-content
$ sudo chmod 775 -R wp-content
セキュリティ的にはちょっとゆるくなるので、更新/削除の時のみ775に変更してそれ以外は755に戻すなどいいかもしれません。
dpkg: error processing package google-cloud-sdk (–configure)
GCEでf1-microでインスタンスを立ててログインすると、まずはとりあえずアップデートをすると思います。
$ sudo apt-get update; sudo apt-get upgrade -y;
するとなんと、
subprocess installed post-installation script returned error exit status 137
えっ。って感じです。ここ数日立てたf1-microはこうなりました。
遺憾です。依存関係かなと思いとりあえず
$ sudo apt-get -f install
をしましたが解決しません。
そこでググるとStack Overflowに
The direct cause may be a lack of memory. Try to add swap before upgrading.
とあったので、まさかと思いスワップファイルを作成。
$ sudo dd if=/dev/zero of=/swap bs=1024k count=2048
$ sudo mkswap /swap
$ sudo chmod 0600 /swap
$ sudo swapon /swap
その後アップグレードすると成功しました。
ところでGCEはデフォルトでスワップがないので、fstabに今回作ったスワップファイルを書いておきましょう。
$ sudo vim /etc/fstab
/swap swap swap defaults 0 0
これで再起動してもスワップが保持されます。
[template id=”99″]
Kusanagi for ConoHa で最低限しておきたいSSHのセキュリティ設定
昨日ぐらいにGCEのf1-micro(とロリポップ)からConoHaに乗り換えました。
このはちゃん可愛い…
普段はDebianを使っているのですがWordPressやらの環境を整えるのが面倒くさいので、手抜きでKUSANAGI for ConoHaを使うことにしました。
CentOSがベースなんですね…うぅ…
では、KUSANAGI for ConoHaに限らず本当に最低限しておきたいセキュリティ設定です。
続きを読む
[Word2Vec] バイナリファイルからテキストファイル、テキストファイルからバイナリファイルへ変換
w2vで処理したのはいいけどバイナリファイルにするの忘れてた!とか、テキストファイルが欲しくなった!とかに使えそうなやつです。
gensimが必要になります。
$ pip install gensim
バイナリファイルからテキストファイルへ変換する場合は、テキストファイルのサイズが大きくなるのでHDD/SSDの記憶容量にご注意ください。
処理にそこそこ時間がかかります。
from gensim.models.keyedvectors import KeyedVectors
# Convert binary file to text file
w2v_model = KeyedVectors.load_word2vec_format('Path to bin file', binary=True)
w2v_model.save_word2vec_format('Path to output', binary=False)
# Convert text file to binary file
w2v_model = KeyedVectors.load_word2vec_format('Path to text file', binary=False)
w2v_model.save_word2vec_format('Path to output', binary=True)
最近のコメント