2017-02-01から1ヶ月間の記事一覧

CentOS7 通常ユーザーでdockerコマンドを実行

VirtualBoxにCentOS7をインストールして、Dockerを動かしてみた。 rootでdockerを入れて、通常ユーザーで、docker コマンドを実行しようとしたらエラーが出た。 $ docker ps Cannot connect to the Docker daemon. Is the docker daemon running on this hos…

gitリポジトリのサイズを減らしたときのメモ

結果 ↓こんな感じでやったらうまくいった。 git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch \ aaa/bbb/ccc.swf \ aaa/bbb/ddd.swf \ aaa/bbb/eee.swf \ cdn_server/' \ --prune-empty --tag-name-filter cat -- --all git gc --pru…

Ansible --start-at-task

Ansible には –start-at-task という、 指定したタスクから開始するオプションがあるけどうまく動かない。 https://github.com/ansible/ansible/issues/11692 deploy% touch ansible.cfg deploy% vi ansible.cfg [defaults] task_includes_static = True han…

ansible をアップグレードしようとしたらエラー

pip install –upgrade ansible でエラー。 pip install --upgrade ansible Collecting ansible Downloading ansible-2.2.1.0.tar.gz (2.5MB) 100% |################################| 2.5MB 404kB/s build/temp.macosx-10.10-x86_64-2.7/_openssl.c:1107:27…

Amazon Linuxで残りディスク容量アラートを設定

メトリクス送信設定 CloudWatchのメトリクスをLinuxから送信して、ディスク容量が減ったらアラートメールを送信するようにする。 Amazon Linux http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html http://docs.aws.amazon.com/ja_jp/AWSE…

PostgreSQLのリプリケーションをしてみるテスト

準備 postgresql94 AWS上にt1.smallでPostgresqlが動いているAmazon Linuxを2台構築。 Amazon Linux $ cat /etc/os-release NAME="Amazon Linux AMI" VERSION="2016.09" ID="amzn" ID_LIKE="rhel fedora" VERSION_ID="2016.09" PRETTY_NAME="Amazon Linux A…

cronで作成日時から一定期間過ぎたファイルを削除

メモ: cronで作成日時から一定期間過ぎたファイルを削除 MAILTO="" # delete files older than 3 days # 1 3,15 * * * find /var/www/app1/shared/docs/ -maxdepth 2 -type f -ctime +3 -delete 1 3,15 * * * find /var/www/app1/shared/docs/input/ -maxde…

ansistranoのafter_symlinkでsudo(become)を実行する

ansible の YAML ansible ansistrano の after_symlink hook で /etc/init.d/ にシンボリックリンクを作る。 - name: initd symlink become: true file: state: link src: /var/www/app1/current/deploy/initd/app1_uwsgi #dest: /home/user1/app1_uwsgi des…