Apache AddType, AddHandler, SetHandler

AddType application/x-httpd-php .php

or

<FilesMatch "\.php$">
  SetHandler application/x-httpd-php
</FilesMatch>

結論からいうと,AddTypeとAddHandlerを複数拡張子のファイルにマッチする脆弱性があるため使う必要はなく,常にSetHandlerを使えばよい。
...
ただし,AddTypeとAddHandlerはファイルが複数の拡張子を持つことを許容する。つまり,exploit.php.jpgというファイル名の場合,真ん中のphpも拡張子としてみなされてマッチする。

AddType, AddHandler, SetHandlerの違い – senooken JP 2020

TLS 1.3

$ openssl version
OpenSSL 1.0.2o-freebsd  27 Mar 2018

$ openssl ciphers -v | awk '{print $2}' | sort | uniq
SSLv3
TLSv1.2

$ openssl version
OpenSSL 1.1.1d-freebsd  10 Sep 2019

$ openssl version
OpenSSL 3.0.12 24 Oct 2023 (Library: OpenSSL 3.0.12 24 Oct 2023)

$ openssl ciphers -v | awk '{print $2}' | sort | uniq
SSLv3
TLSv1
TLSv1.2
TLSv1.3

https://stackoverflow.com/questions/27430158/list-supported-ssl-tls-versions-for-a-specific-openssl-build

php cli opcache

cliでopcacheを有効にしたほうがよいケースはあるか(デフォルト無効)

The opcache.enable_cli option enables PHP OPcache when running PHP scripts from the command line (using the php command). However, keep in mind that for PHP 5.x the OPcache extension works by storing cached opcodes in the memory of the current process. This is only useful when the process that's running PHP is going to be handling multiple requests that can reuse these opcodes, like in a web server or under FastCGI. For a process like the PHP CLI, which runs one "request" and exits, it just wastes memory and time.

https://stackoverflow.com/questions/25044817/zend-opcache-opcache-enable-cli-1-or-0-what-does-it-do

ceph 操作

コマンド

https://gist.github.com/pertoft/a4250bd2826a1be5f341c71c30e9e7e5

ceph -s
ceph -w
ceph health detail
ceph osd df
ceph osd tree

OSDノード停止

OSDノードがハード故障などで、一時停止する場合の手順

1. OSD停止前に、クラスタのリバランスを一時停止

ceph osd set noout
ceph osd set norebalance

https://dokuwiki.fl8.jp/01_linux/13_storage/27_ceph_osd_reboot

backfill_toofull

https://centosquestions.com/how-to-resolve-ceph-pool-getting-activeremappedbackfill_toofull/

  • 不要なデータを削除します。これは、実稼働環境のダウンタイムを回避するための短期的なソリューションです。
  • 新しい OSD ノードを追加してクラスターをスケーリングします。これは、Red Hat が推奨する長期的なソリューションです。
  • backfull_toofull に PG スタックが含まれる OSD の backfillfull の比率を増やし、復元プロセスを続行できるようにします。できるだけ早く新しいストレージをクラスターに追加するか、データを削除して、OSD がいっぱいになるのを防ぎます。

https://access.redhat.com/documentation/ja-jp/red_hat_ceph_storage/4/html/troubleshooting_guide/most-common-ceph-osd-errors

Pool の MAX AVAIL を計算する式
正確な計算式は、次のようになります。

pool.MAX AVAIL=    {osd.AVAIL−(osd.SIZE×(1−full ratio) ) }×num of osd÷pool.size

Ceph Pool の利用可能容量の計算法 - うつぼのブログ 2020

ブロックデバイス RBD 操作

rbd ls swimmingpool
rbd info swimmingpool/bar

[root@rbd-client ~]# rbd rm bar -p swimmingpool

https://access.redhat.com/documentation/ja-jp/red_hat_ceph_storage/4/html/block_device_guide/removing-a-block-device-image_block

OpenStack Cinder

ステート修正

openstack volume list

cinder reset-state --state available --attach-status detached VOLUME

https://stackoverflow.com/questions/76057696/how-can-i-fix-a-cinder-volume-stuck-in-attaching-state

OpenStack Cinder でボリュームを削除するとゼロフィル

注記
Volume の削除をリクエストした後、バックエンドでボリュームのデータ領域に対してゼロで書き込みを行います。そのため、削除に時間がかかることがあります。

https://community.cisco.com/t5/tkb-%E3%83%87%E3%83%BC%E3%82%BF%E3%82%BB%E3%83%B3%E3%82%BF%E3%83%BC-/cvim-openstack-%E3%82%B3%E3%83%9E%E3%83%B3%E3%83%89%E3%81%AB%E3%81%A6-cinder-volume-%E3%82%92%E5%89%8A%E9%99%A4%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/ta-p/4442527

ボリューム削除時にデータを0クリアする
ISCSIDriver を使っている場合、ボリュームの削除に長い時間がかかる事があります。これはボリューム削除時にボリューム全体のデータをクリアする為の書き込みを行なっているからです。

ここがヘンだよ Cinder - Japan OpenStack User Group Japan (JOSUG) openstack.jp 2012

cpan アンインストール

アンインストール ? その 2

つまり、発想としてはインストール時に行った作業の逆をやれば良いだろうということです。
そういうことで、まずは、コマンド rm を使って $HOME/.cpan/ と $HOME/perl5/ を削除しました。

$ rm -rf .cpan/ perl5/

それから $HOME にあるシェルの設定ファイル .cshrc に追加した設定をコメントアウトします。

# eval `perl -I$HOME/perl5/lib/perl5/ -Mlocal::lib`

これで、インストールしたモジュールや、cpan シェルの設定を一掃してやったことになるはずです。
Perl 「 モジュール 」CPAN の ? アンインストール/再インストール (0x97)|Perl Perl_1|blog20100901 2014

postgres tag 配列

The query to find the cats are "red", "brown" and "aloof" is also wonderfully simple.

SELECT Count(*)
FROM cats_array_text
WHERE cat_tags @> ARRAY['red', 'brown', 'aloof'];

Tags and Postgres Arrays, a Purrrfect Combination | Crunchy Data Blog 2023

@> 包含する ARRAY[1,4,3] @> ARRAY[3,1] t
https://www.postgresql.jp/docs/9.2/functions-array.html