継続は力なり

タイトル通り定期的な更新を心掛けるブログです。

【16日目】毎日勉強や

タダです。

大阪出張から帰ってきてから更新滞ってました。。来月ISUCONに出るんですが、その勉強を定期的にしているのでそのまとめてこうと思います。 環境は、ConohaのISUCON7のサーバーです。

ISUCON関連(準備作業中心)

.gitignoreテンプレート

.gitignoreのテンプレートがあるようなのでこれを使います。

github.com

Bitbucketの設定

Bitbucketのアカウント取得とリポジトリを作った後にSSH認証鍵を設定しました。

Host bitbucket.org
    User git
    Port 22
    HostName bitbucket.org
    identityFile 秘密鍵のパス
    TCPKeepAlive yes
    IdentitiesOnly yes
  • Bitbucketへ公開鍵を登録(アカウントの管理より)
  • 接続テスト
ssh -T git@bitbucket.org
The authenticity of host 'bitbucket.org (xxx.xxx.xxx.xxx)' can't be established.
RSA key fingerprint is SHA256:xxxxx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'bitbucket.org,xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.
logged in as xxxxxx.

You can use git or hg to connect to Bitbucket. Shell access is disabled.
  • clone
git clone git@bitbucket.org:ユーザー名/リポジトリ.git

qiita.com techacademy.jp

MySQLの初期データインポート

MySQLの初期データを投入する作業がありました。

zcat [インポートするデータファイルの対象パス | sudo mysql データベース名 default-character-set=utf8mb4

virtualenv起動/終了

仮想環境の起動

source venv/bin/activate

仮想環境の終了

% deactivate

UbuntuにRedisをいれる

コマンド一発っすね

sudo apt-get install redis-server

hiredisを入れる

virtualenv環境でpip使う

source venv/bin/activate
% pip  install hiredis