2015年3月19日木曜日

vagrant

$ vagrant box add centos-6.4-x86_64_Minimal http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20131103.box
==> box: Adding box 'centos-6.4-x86_64_Minimal' (v0) for provider: 
    box: Downloading: http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20131103.box
==> box: Successfully added box 'centos-6.4-x86_64_Minimal' (v0) for 'virtualbox'!

$ vagrant box list
centos-6.4-x86_64_Minimal (virtualbox, 0)
 vagrant init centos-6.4-x86_64_Minimal
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos-6.4-x86_64_Minimal'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: xxxxxx_default_1426690863192_999999
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: 
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default: 
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => /Users/xxxxxx

$ vagrant ssh
Welcome to your Vagrant-built virtual machine.
[vagrant@localhost ~]$ pwd
/home/vagrant
[vagrant@localhost ~]$ exit
logout
Connection to 127.0.0.1 closed.

$ vagrant halt
==> default: Attempting graceful shutdown of VM...


2015年2月7日土曜日

CodeIgniterのActiveRecordのWHERE句の確認(補足)

先のエントリー
http://blog.wakisaka-tsuyoshi.com/2015/01/codeigniteractiverecordwhere.html
where句の中身”すべて”が取得できると思っていたのですが違っていました。

$this->db->like() でセットした条件は、

$this->db->ar_like
に格納されていました。

2015年1月31日土曜日

CodeIgniterのActiveRecordのWHERE句の確認

Confirmation of the WHERE clause of ActiveRecord of CodeIgniter

$this->db->where(); で指定した中身は、
$where = $this->db->ar_where;
で取り出せます。

CodeIgniter でサブクエリ

Subquery in CodeIgniter
ActiveRecord で EXISTS を使用するとき、

$this->db->where("EXISTS (SELECT * FROM hoge WHERE name = '"
. $this->db->escape($name)
. "' AND fuga.hoge_id = hoge.id)",
NULL,
FALSE);

第3引数にFALSE を指定するのがポイント!
そうしないと、EXISTS という文字列自体がエスケープされてしまいます。

2014年10月30日木曜日

CodeIgniter ライセンスが!!!


CodeIgniterのライセンスがMITに!!!

http://pneskin2.nekoget.com/press/?p=1384

2014年10月29日水曜日

非同期通信の待ち合わせ

Meeting of asynchronous communication.


非同期処理の完了を待って次の処理をするようなとき、コールバック地獄にならない便利なjQueryの標準モジュールDeferredです。

いろいろなところで紹介されています。
http://techblog.yahoo.co.jp/programming/jquery-deferred/
http://qiita.com/yuku_t/items/1b8ce6bba133a7eaeb23
http://api.jquery.com/category/deferred-object/

 例えば、非同期でデータを取得してビューにセットするのだけれども、読み込みが完了する前にレンダリング処理されてしまうようなときです。
 特に、非同期読み込む処理が複数のとき、それらの完了を待って描画とするとき、とても便利です。

$.when(
  // 非同期で読み込む処理1
  // 非同期で読み込む処理2
).done(function() {
  // 読み込んだ情報をビューへセット
};


2014年10月17日金曜日

Shellshock Cygwin

Shellshock Cygwin

確認してみました。
バージョンは、4.1.10(4)となっています。

$ env x='() { :;}; echo vulnerable'  bash -c "echo this is a test"


あー脆弱です。。。



https://www.cygwin.com/

こちらのサイトからダウンロード・インストールします。
そして確認です。

バージョンは、4.1.17(9)となっています。



収束したのかな。
こちらを注視です。
https://www.ipa.go.jp/security/ciadr/vul/20140926-bash.html