Deprecated: Creation of dynamic property wpdb::$categories is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$post2cat is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/wp-db.php on line 668

Deprecated: Creation of dynamic property wpdb::$link2cat is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/wp-db.php on line 668

Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-theme.php on line 554

Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-theme.php on line 595

Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-theme.php on line 535

Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-theme.php on line 544

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /usr/home/bugyo/public_html/b-log/wp-includes/comment-template.php on line 1739

Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/rest-api/class-wp-rest-request.php on line 960

Deprecated: Return type of WP_REST_Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/rest-api/class-wp-rest-request.php on line 980

Deprecated: Return type of WP_REST_Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/rest-api/class-wp-rest-request.php on line 992

Deprecated: Return type of WP_REST_Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/rest-api/class-wp-rest-request.php on line 1003

Deprecated: Return type of WP_Block_List::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 151

Deprecated: Return type of WP_Block_List::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 175

Deprecated: Return type of WP_Block_List::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 164

Deprecated: Return type of WP_Block_List::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 186

Deprecated: Return type of WP_Block_List::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 138

Deprecated: Return type of WP_Block_List::offsetExists($index) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 75

Deprecated: Return type of WP_Block_List::offsetGet($index) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 89

Deprecated: Return type of WP_Block_List::offsetSet($index, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 110

Deprecated: Return type of WP_Block_List::offsetUnset($index) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 127

Deprecated: Return type of WP_Block_List::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php on line 199

Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/wp-db.php on line 3030

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Deprecated: Creation of dynamic property WP_Term::$object_id is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-term.php on line 198

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/bugyo/public_html/b-log/wp-includes/class-wp-block-list.php:14) in /usr/home/bugyo/public_html/b-log/wp-includes/feed-rss2.php on line 8
FreeBSD – B-LOG https://blog.bugyo.tk/b-log bugyoのlog。決してblogではない。 Sat, 19 Jan 2013 07:40:38 +0000 en-US hourly 1 https://wordpress.org/?v=5.7.2 [csh] 入力中の前後2文字を入れ替える https://blog.bugyo.tk/b-log/archives/876 https://blog.bugyo.tk/b-log/archives/876#respond Sat, 19 Jan 2013 07:40:38 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://blog.bugyo.tk/b-log/?p=876 csh系のシェルでは、Ctrl-t とすると、カーソル位置とその一つ前の文字を入れ替えることができる。
たとえば、

  % sl

と入力した後で、Ctrl-tを入力すると、

  % ls

となる。

]]>
https://blog.bugyo.tk/b-log/archives/876/feed 0
[コマンド] rlwrap https://blog.bugyo.tk/b-log/archives/818 https://blog.bugyo.tk/b-log/archives/818#respond Wed, 16 Nov 2011 05:58:18 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://blog.bugyo.tk/b-log/?p=818 GNU Rreadlineライブラリは入力の際の便利な機能を提供するライブラリ。これを使用したプログラムでは、入力の際にシェルのようなEmacsキーバインドでの移動や、履歴の呼び出し、カッコの対応の表示などの機能が使えるようになる。

rlwrapはreadlineを使用していないプログラムでもreadlineが使えるように入力をラップするコマンド。
http://utopia.knoware.nl/~hlub/rlwrap/
から入手できる。FreeBSDではportsにあった。

特にLispのREPLではカッコの対応がすぐわかってうれしい。

]]>
https://blog.bugyo.tk/b-log/archives/818/feed 0
[FreeBSD] portsを検索 https://blog.bugyo.tk/b-log/archives/615 https://blog.bugyo.tk/b-log/archives/615#respond Sat, 29 May 2010 13:52:44 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://blog.bugyo.tk/b-log/?p=615 ports から目的の port を探すには ports-mgmt/psearch が便利。

% psearch [options] PATTERN [PATTERN...]

とすることで、正規表現 PATTERN で ports 内を検索し、結果をリストアップしてくれる。

デフォルトでは port の名前(name)と短縮説明(short description)を検索するが、-s オプションを付けることで、詳細な説明(long description)内も検索するようになる。

-c オプションでカテゴリを指定。-n オプションでバージョンも含む、その port の正式名称を出力する。

]]>
https://blog.bugyo.tk/b-log/archives/615/feed 0
[FreeBSD] ldap.confの場所 https://blog.bugyo.tk/b-log/archives/606 https://blog.bugyo.tk/b-log/archives/606#respond Thu, 20 May 2010 15:41:54 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://blog.bugyo.tk/b-log/?p=606 ports から pam_ldap や nss_ldap を入れた場合、openldap-client が自動で入る。

pam_ldap 用の ldap.conf.dist が/usr/local/etc にできるので、これを /usr/local/etc/ldap.conf にコピーして設定したが、ldapsearch などに反映されず、嵌った。

man ldap.conf によると、openldap-client の見る ldap.conf の場所は /usr/local/etc/openldap/ldap.conf だった。

要注意。

]]>
https://blog.bugyo.tk/b-log/archives/606/feed 0
[FreeBSD][UFS] 定期的にSnapshotを作成 https://blog.bugyo.tk/b-log/archives/550 https://blog.bugyo.tk/b-log/archives/550#respond Thu, 04 Feb 2010 15:59:55 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://blog.bugyo.tk/b-log/?p=550 Continue reading [FreeBSD][UFS] 定期的にSnapshotを作成]]> UFSにはSnapshot機能があることは知っていたが、いつか試そうと思って放っていた。

今日rm *~しようとしてrm *してしまい激しく後悔。

定期的にSnapshotを作成するように設定することにした。

『FreeBSD UFS Snapshot Management Environmentを使って定期的にSnapshotを作成する』 – mteramotoの日記
によるとFreeBSD UFS Snapshot Management Environmentというのがあって、設定したスケジュールに従ってSnapshotをrotateしてくれるらしい。

sysutils/freebsd-snapshotというportsになっているのでこれをインストール。

/etc/crontabに

# /etc/crontab
0	*	*	*	*	root	/usr/local/sbin/periodic-snapshot hourly
0	0	*	*	*	root	/usr/local/sbin/periodic-snapshot daily
0	0	*	*	0	root	/usr/local/sbin/periodic-snapshot weekly

と記述してperiodic-snapshotを呼び出す時間を指定。

スケジュールは/etc/periodic.confに記述する。

インストール時には作られないので新規に作成。

napshot_enable="YES"
snapshot_schedule="/usr,/usr/pub:2:10:0"

のように書く。

/usrとか/usr/pubとかはマウントポイント。

snapshot_scheduleの書式は

<schedule>
::= <entry>*
<entry>
::= <fs> (", <fs>)* : <spec>
<fs>
::= /^.*$/
<spec>
::= <gen_weekly> : <gen_daily> : <gen_hourly> <gen_weekly> 
::= <generation>
<gen_daily>
::= <generation> <gen_hourly> 
::= <generation> ("@ <hour> (", <hour>)*)? <generation> 
::= /^[0-9]+$/
<hour>
::= /^(0?[0-9]|1[0-9]|2[0-3])$/

のようになっていて、週ごと、日ごと、時間ごとに保持するSnapshotの個数を指定する。

はじめは2:2:2とかにしてみたが、毎時のSnapshotの作成に5分ほどかかる。

わりと負荷が高いので今のところ2:10:0としている。

空き容量を気にしながらしばらくは様子見。

参考
『FreeBSD UFS Snapshot Management Environmentを使って定期的にSnapshotを作成する』 – mteramotoの日記
『periodic-snapshot — run periodic UFS/ZFS backup snapshot maintenance task』

]]>
https://blog.bugyo.tk/b-log/archives/550/feed 0
GN-1200TW2 https://blog.bugyo.tk/b-log/archives/522 https://blog.bugyo.tk/b-log/archives/522#respond Sat, 16 Jan 2010 13:39:12 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://blog.bugyo.tk/b-log/?p=522 Continue reading GN-1200TW2]]> 『FreeBSD 8.0-RELEASEでvgeドライバに不具合』
に書いた問題で、パッチがHEADにコミットされたようだがStableに落ちてこない。

Currentにすれば良かったが、GENERICを捨てる気力が無く、チキンにも別NICを用意することにした。

PLANEXのGN-1200TW2を1200円ほどで購入。

チップはRealTechのRTL8269SCで、FreeBSDではre0として認識された。

re0:  port 0xa000-0xa0ff mem 0xf9011000-0xf90110ff irq 18 at device 4.0 on pci1
re0: Chip rev. 0x10000000
re0: MAC rev. 0x00000000
miibus0:  on re0
rgephy0:  PHY 1 on miibus0
rgephy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
re0: Ethernet address: 00:22:cf:22:ea:cf
re0: [FILTER]

ジャンボフレーム対応だが7000byteまで。GbE-PCI2(VT6122)は9000byteまでだった。

Netperfでスループットを計測してみる。
環境は、

ホスト1
OS: FreeBSD 8.0-RELEASE-p2
NIC: GN-1200TW2
CPU: Athlon64 3000+

ホスト2
OS: WindowsXP
NIC: nForce2 オンチップ
CPU: Celeron 2.0GHz

間にCG-SW05GTPLXBを挟んでいる。

結果
Recv   Send    Send
Socket Socket  Message  Elapsed
Size   Size    Size     Time     Throughput
bytes  bytes   bytes    secs.    10^6bits/sec

  8192  32768  32768    10.00     440.97

421Mbps、つまり53MB/s出ており、GbE-PCI2と比べて遜色ない。

ベンチマーク中はinterruptで激しくCPU時間を消費していたので、速いマシンで計測すればもっと良い結果が出るかも。

]]>
https://blog.bugyo.tk/b-log/archives/522/feed 0
FreeBSD 8.0-RELEASE https://blog.bugyo.tk/b-log/archives/509 https://blog.bugyo.tk/b-log/archives/509#respond Fri, 11 Dec 2009 05:07:40 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://blog.bugyo.tk/b-log/?p=509 自宅サーバのOSをFreeBSD 7.2-RELEASSEからFreeBSD 8.0-RELEASEにアップグレード。

久々のメジャーバージョンアップ。

『FreeBSD 7.1-RELEASE』
の通り、freebsd-updateでアップデートできた。

]]>
https://blog.bugyo.tk/b-log/archives/509/feed 0
Sendmail で OP25B 回避 https://blog.bugyo.tk/b-log/archives/448 https://blog.bugyo.tk/b-log/archives/448#respond Wed, 28 Oct 2009 07:16:52 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://www.kitcc.org/~bugyo/b-log/?p=448 Continue reading Sendmail で OP25B 回避]]> 自宅に置いてあるウェブサーバ(FreeBSD)に wordpress を入れて blog サービスを運営している。

メールサーバは間に合っているのでこのサーバでメールを受け取る必要はないが、blog にコメントが付いたときにメールで通知するサービスなどは欲しいからメールが送れるようにはしたい。

しかし、プロバイダの OP25B によってこのサーバ自身が直接メールを送ることはできない。

そこで、OP25B の影響がない別のメールサーバにメールを中継してもらうことにする。

MTA では Postfix が設定もわかりやすくてよいと思うが、FreeBSD のベースシステムに組み込まれている MTA はSendmail で、メールを1箇所に中継以来するだけでメールサーバを入れ替えるのも仰々しいので今回は Sendmail で設定してみることにした。

sendmail.cfを作る

Sendmail システムの振る舞いは /etc/mail/sendmail.cf に記述するが、m4 マクロによってこれを生成する仕組みが用意されているのでそれを使うことにする。

/etc/mail に移動すると freebsd.mc というファイルがあってこれがデフォルトの sendmail.cf を生成する m4 マクロ。

/etc/mail には Makefile があって make コマンドで sendmail.cf が作れるようになっている。

とりあえず

#su
#make

としてみる。

初回の make では

cp freebsd.mc your.host.name.submit.mc
/usr/bin/m4 -D_CF_DIR_=/usr/share/sendmail/cf/   /usr/share/sendmail/cf/m4/cf.m4 your.host.name.mc > your.host.name.cf

のように出て、ホスト名.mc というファイルができるので以後これを編集、make して ホスト名.cf を得る。

今回のように特定のメールサーバに中継を依頼するにはSMART_HOSTマクロを設定すればいいよう。

nullclientではメールアドレスの @ 以下が中継を依頼したホスト名に書き換わってしまう。

your.host.name.mc に以下を追記。

dnl your.host.name.mc
define(`SMART_HOST', `relay.smtp.server')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
FEATURE(`authinfo', `hash /etc/mail/relay-auth')
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')
define(`confAUTH_MECHANISMS', 'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl

m4ではdnl以下はコメント。

行末にdnlをつけているのは、マクロ置換した後 define 文が空行として残らないようにするためで、必要というわけではない。

define(`SMART_HOST’, `relay.smtp.server’)dnl
SMART_HOSTの設定。relay.smtp.server は中継を依頼するサーバ。
cf ファイルでは DSrelay.smtp.server という行になる。

define(`ESMTP_MAILER_ARGS’, `TCP $h 587′)dnl
メールを送るプログラムの引数を指定。
TCPはsendmailに内蔵されているSMTPでメールを送るプログラム。
$hは相手のホスト名で通常はメールアドレスの@以下だけどSMART_HOSTを設定した場合は中継依頼するサーバ。
SMTPの25番で送ったのではOP25Bに引っかかってしまうので配送ポートで送っている。

FEATURE(`authinfo’, `hash /etc/mail/relay-auth’)
SMTP-Authによる認証を使用するのでその設定を呼び出す。
/etc/mail/relay-auth は後で作成。

TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)
define(`confAUTH_MECHANISMS’, ‘EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
使用する認証システムを指定。

あとは make してできた your.host.name.cf を

# cp your.host.name.cf sendmail.cf
# /etc/rc.d/sendmail restart

として sendmail.cf にコピーして、sendmail をリスタートすれば設定が反映される。

ただ、ベースシステムの sendmail をそのまま使っているので SMTP-Auth のモジュールが組み込まれていないと Warning が出る。sendmail を SASL が使えるように設定してリビルドする必要がある。

Sendmail をリビルド

とりあえず SASL が使えるように ports から security/cyrus-sasl2 を入れる。

コンフィグはデフォルトのままでよかった。

次に /etc/make.conf に以下を追記。

# /etc/make.conf
SENDMAIL_CFLAGS=-I/usr/local/include -DSASL=2
SENDMAIL_LDFLAGS=-L/usr/local/lib
SENDMAIL_LDADD=-lsasl2

sendmail をリビルド。ソースを展開してない場合は csup などで取得、展開しておくこと。

# cd /usr/src/lib/libsmutil
# make obj && make depend && make
# cd /usr/src/lib/libsm
# make obj && make depend && make
# cd /usr/src/usr.sbin/sendmail
# make obj && make depend && make && make install

再び sendmail をリスタートすると Warning は消えた。

認証データベースを作る

先ほど sendmail.cf に設定した /etc/mail/relay-auth を作る。

/etc/mail/relay-auth に

AuthInfo:your.host.name "U:name" "I:name@your.host.name" "P:password"

のように記述する。I には認証IDを書く。普通はPOPの認証IDと同じなのでドメインまで入れる必要があるかは要確認(eonet.ne.jp では@の代わりに%)。

その後、

# cd /etc/mail
# makemap hash relay-auth < relay-auth
# chmod 600 relay-auth.db relay-auth

とすると、relay-auth.db ができて認証データベースの作成は完了。パスワードが書かれたファイルなのでパーミッションを 600 にしておく。

中継するサーバを設定

プロバイダが中継を受け入れてくれる場合は以上でメールが送信できるようになるが、そうでない場合は中継を受け入れるサーバを用意しておく必要がある。

自分の環境の場合、こちらも FreeBSD だが MTA は Postfix なので Postfix の場合について書く。

とりあえず ports から security/cyrus-sasl2 を入れる。コンフィグはそのままでよかった。

Postfix を SASL 付きでビルドしていない場合にはコンフィグで SASL を有効にしてリビルドしておく。

/usr/local/etc/postfix/main.cf を修正。

smtpd_sasl_auth_enable=yes
smtpd_sasl_security_options=noanonymous

smtpd_recipient_restrictions =
  permit_mynetworks,
  permit_sasl_authenticated,
  reject_unauth_destination

smtpd_recipient_restrictions はSMTPで送信先のアドレスを受け取ったときに許可するかどうかの設定なので、要は中継を許可するかどうかの設定。

おそらく元からある設定なので、 permit_sasl_authenticated を追記した形になる。

あとは、

# saslpasswd2 -c -u mydomainname myaccount
# postfix reload

として relay-auth で設定したのと同じパスワードを設定してやればよい。

参考
近頃のsendmail事情

]]>
https://blog.bugyo.tk/b-log/archives/448/feed 0
Syntax error: Bad fd number https://blog.bugyo.tk/b-log/archives/440 https://blog.bugyo.tk/b-log/archives/440#respond Mon, 12 Oct 2009 16:26:49 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://www.kitcc.org/~bugyo/b-log/?p=440 shでcsh系のリダイレクト記法>&を用いたときに出るエラー。

crontabの記述でやりがちなので注意。

crontabに記述したコマンドは標準ではshで実行される。

FreeBSDではcrontabの先頭に

SHELL=/bin/csh

と書くことでcshの記法が使える。

]]>
https://blog.bugyo.tk/b-log/archives/440/feed 0
sshdの待ち受けポートを変更する https://blog.bugyo.tk/b-log/archives/429 https://blog.bugyo.tk/b-log/archives/429#respond Thu, 10 Sep 2009 05:05:50 +0000
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 378

Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 379

Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 380

Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 381

Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 382

Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /usr/home/bugyo/public_html/b-log/wp-includes/category.php on line 383
http://www.kitcc.org/~bugyo/b-log/?p=429 デフォルトのポート番号ではどこからか辞書攻撃されるのでsshdの待ち受けポート番号を変更する。

FreeBSDではsshdの設定は /etc/ssh/sshd_config に記述する。

Port 22

となっているところを、任意のポート番号に変更すればよい。

その後、

# /etc/rc.d/sshd restart

として、sshdを再起動する。

]]>
https://blog.bugyo.tk/b-log/archives/429/feed 0