2013-02-01から1ヶ月間の記事一覧
ファイルを一括置換するときに、 find /path/to/dir -type f | xargs sed -i "s/hoge/foobar/g" みたいにコマンドを打つことがあると思いますが、 Macでは、 sed: 1: "/path/to/dir": invalid command code . や、 sed: 1: "path/to/dir/file": extra charac…
curlでファイルを送ろうとしたら少しハマったので、メモ。curl コマンドでファイルを送る方法は、manを見ると以下のようになっている。 -F/--form <name=content> (HTTP) This lets curl emulate a filled-in form in which a user has pressed the sub- mit button. This </name=content>…
設定する度にググっているのでメモ。 Apache # Basic auth AuthUserFile /var/www/html/example.com/.htpasswd AuthGroupFile /dev/null AuthName "basic authentication" AuthType Basic require valid-user Satisfy any Order deny,allow Deny from all Al…
sshでID / PW や接続先は間違っていないのに、タイトルのようなエラーが出てアクセス出来ない時がある。 エラーの意味は、設定している最大試行回数を超えたというもの。 接続情報が間違っていないのに試行回数を超えてしまうかというと、登録している鍵が多…
バージョン情報を表示するのはセキュリティ上あまり良くないので、非表示にしたい。 という時の設定。 Apache 以下をhttpd.conf に書けば全体に反映される。 ServerTokens Prod 以下を設定すると、Apache Server ... も消すことができる。 ServerSignature O…
拡張子で判断。 大抵の場合はこれでいいはず。 location ~ \.(js|css|png|jpe?g|gif|swf|txt|ico) { root /path/to/dir; }
Mac OS X Lion だけで発生する現象かはわからないが、 VPN接続中に /etc/hosts を編集しても、 VPNの接続を切ると変更した内容が元に戻ってしまうという現象が起きた。 というメモ。
PHPExcelで日付データを取得しようとしたときに、 1970/1/1 ではなく、 25569 が取得されてしまった。 調査した結果、Excel では、日付データを 1900/1/1 からの経過日数で保存しているためということがわかった。ExcelではTEXTという関数があって、それを使…
毎回ググっているので、メモしておく。 鍵作成 ssh-keygen -f ~/.ssh/example.com_rsa -t rsa Generating public/private rsa key pair. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in …
php composer.pher install|update で、 Class .... is not autoloadable, can not call post-update-cmd script が出たら、 vendor を消して入れなおせばいいそうです。 一々消すの面倒ですね。※参考 https://github.com/symfony/symfony-standard/issues/2…