地方エンジニアの学習日記

興味ある技術の雑なメモだったりを書いてくブログ。たまに日記とガジェット紹介。

2021-02-02から1日間の記事一覧

【C】マクロ

C

拝啓 カーネルソース読んでるとよく出てくる「do {} while (0);」 これが何なのか気になったので調べてみました。 torvalds/linux 以下swap関数のようなイメージ 至るところでdo {} while(0)が存在 /** * swap - swap values of @a and @b * @a: first value…

【Ansible】ansible-docコマンド

使い方 helpを見るとこんな感じになっています。 *バージョンは2.4.3 bash-3.2$ ansible-doc -h Usage: ansible-doc [-l|-s] [options] [-t

【Go】defer

Go

Goには、deferステートメントというものがあり、deferへ渡した関数実行を、その呼び出し元の関数の終了時(return)まで遅延させることができます。 package main import "fmt" func main() { // main関数の最後に実行される defer fmt.Println("world.") fmt.…

【vim】Git Commit Problem: "error: There was a problem with the editor 'vi'"

よくわからんけど表示されていたのでググったら解決したエラーメッセージ。 github.com git config --global core.editor /usr/bin/vim

【Apache】apacheのビルドオプションを調べる

どんなビルドオプションで入れたかを調べるためのコマンド apachectl -V github.com Server version: Apache/2.2.9 (Unix) Server built: Oct 13 2008 21:48:41 Server's Module Magic Number: 20051115:15 Server loaded: APR 1.2.7, APR-Util 1.2.7 Compil…