Macの便利なショートカットのメモ
■内部辞書を起動
調べたい箇所にカーソルを合わせてショートカットを押す。
⌃(control) + ⌘(command) + D
■内部辞書を起動
調べたい箇所にカーソルを合わせてショートカットを押す。
⌃(control) + ⌘(command) + D
mysqldump -u ユーザ名 -p DB名 > 出力先ファイル名
mysqldump --default-character-set=utf8 -u ユーザ名 -p DB名 > 出力先ファイル名
mysqldump -u root -x --all-databases > dump.sql
#この行をコメントアウト #php_admin_value engine Off
#Subsystem sftp /usr/libexec/openssh/sftp-server Subsystem sftp internal-sftp
Match User designer
ChrootDirectory /var/www
ForceCommand internal-sftp
sudo apt-get install update-manager-core
sudo do-release-upgrade
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 13.04 Release: 13.04 Codename: raring
500 OOPS: vsftpd: refusing to run with writable root inside chroot ()
allow_writeable_chroot=YES
500 OOPS: priv_sock_get_cmd
seccomp_sandbox=NO
$mem = memory_get_usage();
$mem = number_format($mem);
print("Memory:{$mem}");
で調べましょう。// タイムゾーンを設定する
date_default_timezone_set('Asia/Tokyo');
// タイムゾーンを表示させる
echo date_default_timezone_get();
$criteria->join.=' LEFT JOIN {{table_a}} a ON t.table_a_id=a.id ';
※メインのtableは t というデフォルトの別名が付きます。
$criteria->params[':name']="%{$name}%"; // 文字列
$criteria->params[':test_1']=$test_1; // 数値等
$criteria->addCondition('t.title LIKE :title OR t.comment LIKE :comment');
$criteria->params[':title']="%{$search['text']}%";
$criteria->params[':comment']="%{$search['text']}%";
$criteria->addInCondition('group_id', $group_id_array);
$commands=Yii::app()->db->createCommand()
->from('{{member}} t')
->leftJoin(
'{{member_category_relation}} c',
't.id=c.member_id AND c.group_id=:group_id'
,
array(
':group_id'=>$this->_group->id,
)
)
->select(array(
't.id AS id',
'name',
'category_id',
't.update_time AS update_time'))
->where(
array('in', 't.id', $member_ids)
);
// 後から追加も可能
$commands->order=$order_sql;
// コマンド実行
$datas=$commands->queryAll();
$(this).datepicker('destroy').datepicker({
showOn:'focus',
dateFormat: "yy-mm-dd",
}).focus();
$('.datepicker').not('.hasDatePicker').datepicker({
dateFormat: "yy-mm-dd",
showOn:'focus',
});
datePickerが2個でることで起こるバグっぽいので、git checkout file_path
#ディレクトリごと git rm --cached -r dir/ #ファイルだけ git rm --cached file_path
Warning: Maximum number of allowable file uploads has been exceeded in Unknown on line 0
max_input_vars = 2000を追記
$ /Applications/MAMP/Library/bin/mysql -u root -p
souce souce_file_path
public $layout='application.views.layouts.console.main';
git remote set-url remote_config_name:/home/userdir/repo
#!/bin/sh
#ブランチ名の取得
branch=$(git rev-parse --symbolic --abbrev-ref $1)
# 本番・テスト環境へ反映
if [ "$branch" = "product" ]
then
cd /home/product_user/public_html
git --git-dir=.git pull ../repo/repo.git product:master
# テスト環境にも反映
cd /home/test_user/public_html
git --git-dir=.git pull ../repo/repo.git product:master
# リモートのbareリポジトリのmasterブランチとproductブランチを入れ替える
cd /home/repo_user/repo/repo.git
git --git-dir=../repo.git symbolic-ref HEAD refs/heads/product
git --git-dir=../repo.git branch -d master
git --git-dir=../repo.git branch -m product master
fi
# テスト環境のみへ反映
if [ "$branch" = "master" ]
then
cd /home/test_user/public_html
git --git-dir=.git pull ../repo/repo.git master
fi
exec git update-server-info
git --git-dir=../repo.git symbolic-ref HEAD refs/heads/productとして、gitディレクトリにrepo.git自身を指定してgit 命令を実行しています。
git symbolic-ref HEAD refs/heads/productこれでbareリポジトリのmasterブランチからproductブランチにcheckoutする事が出来ました。
# 初期設定はUTC $ date Mon Jul 8 8:31:49 UTC 2013 # 日本の zoneinfo をコピー $ sudo cp /usr/share/zoneinfo/Japan /etc/localtime # 確認 $ date Mon Jul 8 17:31:49 JST 2013
git fetch
git fetch
git fetch remote_rep
git fetch --all
git fetch git://example.com/rep.git branch:local_branch
git log FETCH_HEAD
git diff FETCH_HEAD
git merge FETCH_HEAD
$ sudo apt-get install php5-curl
extension=curl.soを追記。
<ifmodule mod_userdir.c="">
<directory home="" public_html="">
# php_admin_value engine Off ←この行をコメントアウト!
</directory>
</ifmodule>
です。¥ a2ensite another_siteとしても、
pasv_enable=YES pasv_min_port=60000 pasv_min_port=60010
SSLCertificateFile /etc/apache2/ssl/crt/domainname.crt
SSLCertificateChainFile /etc/apache2/ssl/ca/domainname.cacert
SSLCertificateKeyFile /etc/apache2/ssl/key/domainname.key
apache再ロード
確認してアクセスして終わり