tag:blogger.com,1999:blog-10806823616413535302024-03-09T04:38:24.312+09:00殿様ガエルのブログ完全に備忘録。それ以上でもそれ以下でもない。
不定期更新。気が向いたら書いています。
こちらもよろしく→http://w.livedoor.jp/frogapp/Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.comBlogger56125tag:blogger.com,1999:blog-1080682361641353530.post-1247328259444447312013-01-24T18:02:00.003+09:002013-01-24T18:02:36.171+09:00ブログ移行します。はてなブログに移行します。<br />
<br />
理由はmarkdown記法ができ、ソースコードが綺麗に簡単に表示できるからです。<br />
<br />
markdown記法ができるわけではないのですが、覚えていきます。<br />
<br />
結局備忘録な感じで書いているのですが、、、<br />
<br />
<a href="http://tonosama.hatenablog.jp/" rel="nofollow" target="_blank">http://tonosama.hatenablog.jp/</a>Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-15684786812111158892013-01-13T03:17:00.000+09:002013-01-13T03:18:29.796+09:00シェルスクリプト実験を自動化するためシェルスクリプトを作成中
以下は基礎
残りは、ファイル出力ぐらいか。
とるデータを決めないと次へは進めない、、、
<pre class="prettyprint">
#!/bin/bash
function print_usage {
name=`basename $0`
echo "Usage:
$name host other_host instance_name
For example:
$name 12 0
"
}
#変数の数チェック
if [ "$#" -eq 2 ];then
echo "ok"
else
print_usage
exit 1
fi
#ansを数値として扱う
declare -i ans
#初回起動
echo $2 $1
#10回回すよー
for((i=1;i<=10;i++))
do
ans=$(($i%2))
if [ "${ans}" -eq 1 ];then
sleep 2;echo $1 $2
else
sleep 2;echo $2 $1
fi
done
</pre>
以下、結果
<pre class="prettyprint">./serch.sh 12 3
ok
3 12S
12 3
3 12
12 3
3 12
12 3
3 12
12 3
3 12
12 3
3 12
</pre>
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-36488157023799932452013-01-06T01:32:00.001+09:002013-01-06T01:32:27.068+09:00pythonでいこう プログラミングのお勉強をしようと思い、pythonの勉強を始めました。
まぁ文法をそこまで理解できているわけではないけど、objective-cやjavaなどは触ったことがあるので似たような似たようなものだと思われる。癖はあるかもしれないけど作りたいものを決めてやっていくうちに覚えることができるはず。
作りたいものを作る→復習→作りたいものを作るの
のサイクルが一番頭に入ると思っているのでね
pythonの導入は下記を参考にしました。
<a href="http://toggtc.hatenablog.com/entry/2012/02/06/023342">Mac OS X 10.7.3 Lionでpythonbrew, virtualenv, pip, buildoutなPython環境を構築する 第1回 はじめに</a>
virtualenvで仮想環境をつくってやるようです。便利ですね。
俺メモ
<pre class="prettyprint">pythonbrew venv use py27</pre>
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-634101517356641782012-12-27T16:17:00.000+09:002013-01-22T15:54:15.312+09:00devstackを用いてOpenStackを導入してからライブマイグレーションを行いたい その2openstackでライブマイグレーションさせるためにいろいろやっていきます<br />
openstackはdevstackを用いてインストールした。<br />
<br />
参考URLは下記<br />
<a href="http://docs.openstack.org/trunk/openstack-compute/admin/content/configuring-migrations.html">http://docs.openstack.org/trunk/openstack-compute/admin/content/configuring-migrations.html</a><br />
<br />
追加参考文献<br />
<a href="http://blog.csdn.net/xjtuse_mal/article/details/7899511">http://blog.csdn.net/xjtuse_mal/article/details/7899511</a><br />
<br />
コントローラ側<br />
<br />
$sudo apt-get -y install nfs-kernel-server<br />
<br />
$sudo vim /etc/exports<br />
(e.g)<br />
<br />
NOVA-INST-DIR/instances HostA/255.255.0.0(rw,sync,fsid=0,no_root_squash)<br />
<div>
<br /></div>
<div>
/opt/stack/data/nova/instances <controller>/255.255.255.0(rw,sync,fsid=0,no_root_squash)</controller></div>
<div>
<br /></div>
<div>
<div>
$ sudo /etc/init.d/nfs-kernel-server restart</div>
<div>
$ sudo /etc/init.d/idmapd restart</div>
</div>
<div>
<br /></div>
<div>
ノード側</div>
<div>
$sudo apt-get -y install nfs-common</div>
<div>
<br /></div>
<div>
$sudo vim /etc/fstab</div>
<div>
<br /></div>
<div>
<controller>HostA:/ /opt/stack/data/nova/instances/ nfs4 defaults 0 0</controller></div>
<div>
<br /></div>
<div>
$sudo mount -a -v</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
コントローラとノードどちらともで</div>
<div>
<br /></div>
<div>
<div>
/etc/libvirt/libvirtd.conf:</div>
<div>
<br /></div>
<div>
before : #listen_tls = 0</div>
<div>
after : listen_tls = 0</div>
<div>
<br /></div>
<div>
before : #listen_tcp = 1</div>
<div>
after : listen_tcp = 1</div>
<div>
<br /></div>
<div>
add: auth_tcp = "none"</div>
</div>
<div>
<br /></div>
<div>
<div>
/etc/default/libvirt-bin</div>
<div>
<br /></div>
<div>
before :libvirtd_opts=" -d"</div>
<div>
after :libvirtd_opts=" -d -l"</div>
</div>
<div>
<br /></div>
<div>
<div>
$ sudo stop libvirt-bin && sudo start libvirt-bin</div>
<div>
$ ps -ef | grep libvirt</div>
</div>
<div>
<br /></div>
<div>
<div>
root 1145 1 0 Nov27 ? 00:00:03 /usr/sbin/libvirtd -d -l<br />
<br />
<br />
live_migration_flag=VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE<br />
live_migration_uri=qemu+tcp://%s/system<span class="Apple-tab-span" style="white-space: pre;"> </span><br />
<div>
<br /></div>
</div>
</div>
<div>
<br /></div>
<div>
....umakuikanai<br />
<br />
追記!!<br />
<br />
追加参考文献を参考に行ったらうまくいくようになった。<br />
やったね!!</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-17074335767323917122012-12-20T04:22:00.004+09:002012-12-20T04:22:56.195+09:00その3openstackのその3<br />
<br />
ノードを追加する<br />
<br />
localrcは<br />
<br />
<blockquote>
HOST_IP=192.168.11.6<br />ADMIN_PASSWORD=openstack<br />MYSQL_PASSWORD=$ADMIN_PASSWORD<br />RABBIT_PASSWORD=$ADMIN_PASSWORD<br />SERVICE_PASSWORD=$ADMIN_PASSWORD<br />SERVICE_TOKEN=admintoken-2012<br />ENABLED_SERVICES=n-cpu,rabbit,g-api,quantum,q-agt<br />ENABLE_TENANT_TUNNELS=True<br />SERVICE_HOST=192.168.11.5<br />MYSQL_HOST=$SERVICE_HOST<br />RABBIT_HOST=$SERVICE_HOST<br />Q_HOST=$SERVICE_HOST</blockquote>
<div>
IPとパスは臨機応変に</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-12649704125138051722012-12-20T03:55:00.002+09:002012-12-28T14:50:06.835+09:00インスタンスを作成インストールでけた。<br />
<br />
参考URL<br />
<br />
<a href="http://networkstatic.net/openstack-folsom-quantum-devstack-installation-tutorial/">http://networkstatic.net/openstack-folsom-quantum-devstack-installation-tutorial/</a><br />
<br />
<br />
<blockquote class="tr_bq">
wget https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-disk1.img<br />
glance add name=Ubuntu-12.04 is_public=true container_format=ovf disk_format=qcow2 < precise-server-cloudimg-amd64-disk1.img</blockquote>
<div>
<br /></div>
<div>
をやって、イメージを登録するお</div>
<div>
<br /></div>
<div>
その後、Horizonにアクセスし</div>
<div>
セキュリティグループを編集(defaultがあるのでそいつを)</div>
<div>
tcp 22 22</div>
<div>
icmp -1 -1</div>
<div>
<br /></div>
<div>
sshとpingを通せるようにポートを開放してるのかな</div>
<div>
<br /></div>
<div>
で、インスタンスを作成。登録したイメージで作成しましょう。</div>
<div>
<br /></div>
<div>
キーペアを作ってダウンロード。openstackのコントローラが入ってるOSに入れておきましょう。</div>
<div>
そして、そのサーバから</div>
<div>
ssh -i <key> ubuntu@<ip address="address"></ip></key></div>
<div>
で、アクセスできるはずだけど、できないかも、、、</div>
<div>
<br /></div>
<div>
とりあえず、フローティングipなるものを作成しないといけないらしい。</div>
<div>
フローティングipとは、外部にアクセスするために必要なもの。</div>
<div>
<br /></div>
<div>
自分がわかる程度に適当に書きます。</div>
<div>
GUIでフローティングipを割り当てる。その後</div>
<div>
<br /></div>
<blockquote class="tr_bq">
source openrc admin admin<br />
nova list<br />
quantum port-list -- --device_id <ip_address><br />quantum floatingip-list<br /><span class="s1">quantum floatingip-associate <floatingip-id> <internal port-id="port-id" vm="vm"></internal></floatingip-id></span></ip_address></blockquote>
<div>
<br /></div>
<div>
これでイケる</div>
<div>
<br /></div>
<div>
source openrc admin admin</div>
<div>
<br /></div>
<div>
にしてるけど、なぜかテナントをdemoの方で上記のものを作成しないとつながらないT_T</div>
<div>
<br /></div>
<div>
理由がわからない。</div>
<div>
<br /></div>
<div>
とりあえず、sshでインスタンスにアクセスできました。</div>
<div>
次は、ライブマイグレーションを目指す。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-65935611265822272012-12-20T02:31:00.002+09:002013-01-22T01:03:48.784+09:00devstackを用いてOpenStackを導入してからライブマイグレーションを行いたい その1devstackを用いてOpenStackを導入してからライブマイグレーションを行いたいと考えています。<br />
<br />
OpenStackについて理解できていないところは数多く。自分のミスなのかバグなのかもわかりません。しかし、頑張ります。なぜなら、これができないと卒業できないから!!<br />
<br />
マイグレーションを行うまでの道程を書いて行きます。<br />
<br />
まず、devstackを用いてOpenStackをインストールします。<br />
自分で導入するにはハードルが高すぎます。<br />
<br />
参考URLは<br />
<a href="https://github.com/irixjp/openstack-study-9/wiki/%E4%BA%8B%E5%89%8D%E6%BA%96%E5%82%99">https://github.com/irixjp/openstack-study-9/wiki/%E4%BA%8B%E5%89%8D%E6%BA%96%E5%82%99</a><br />
<br />
コントローラーのlocalrcは<br />
<br />
<pre style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(204, 204, 204); margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px;"><span style="background-color: transparent; font-size: 12px; line-height: 19px;"><span style="color: #333333; font-family: Consolas, Liberation Mono, Courier, monospace;">HOST_IP=192.168.13.2
ADMIN_PASSWORD=stacktera
MYSQL_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=admintoken
disable_service n-net
disable_service n-obj
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
ENABLE_TENANT_TUNNELS=True
FIXED_RANGE=192.168.4.0/24
NETWORK_GATEWAY=192.168.4.254
FLOATING_RANGE=192.168.13.128/25
MULTI_HOST=True
SYSLOG=True
LOGFILE=/opt/stack/logs/stack.sh.log
FLAT_INTERFACE=eth0
FIXED_NETWORK_SIZE=256
PUBLIC_INTERFACE=eth0
#OFFLINE=True
NOVA_BRANCH=stable/folsom
GLANCE_BRANCH=stable/folsom
KEYSTONE_BRANCH=stable/folsom
HORIZON_BRANCH=stable/folsom
CINDER_BRANCH=stable/folsom
QUANTUM_BRANCH=stable/folsom</span></span></pre>
<pre style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(204, 204, 204); margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px;"><span style="background-color: transparent; color: #333333; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 19px;">
</span></pre>
<pre style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(204, 204, 204); margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px;"><span style="background-color: transparent; color: #333333; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; line-height: 19px;">ノード側のlocalrcは</span></pre>
<div>
<code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"><br /></code>
<code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"></code><br />
<pre style="background-color: #f8f8f8; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: 1px solid rgb(204, 204, 204); margin-bottom: 15px; margin-top: 15px; overflow: auto; padding: 6px 10px;"><code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; margin: 0px; padding: 0px;"><code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; margin: 0px; padding: 0px;"><span style="color: #333333; font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px; line-height: 19px;">HOST_IP=192.168.0.112
ADMIN_PASSWORD=openstack
MYSQL_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=admintoken-2012
FLAT_INTERFACE=eth0
FIXED_RANGE=192.168.4.0/24
FIXED_NETWORK_SIZE=256
FLOATING_RANGE=192.168.13.128/25
MULTI_HOST=1
LOGFILE=/opt/stack/logs/stack.sh.log
ENABLED_SERVICES=n-cpu,rabbit,g-api,quantum,q-agt
ENABLE_TENANT_TUNNELS=True
SERVICE_HOST=192.168.0.112
MYSQL_HOST=$SERVICE_HOST
RABBIT_HOST=$SERVICE_HOST
Q_HOST=$SERVICE_HOST
</span></span></code></code></pre>
<div>
<code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"><code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"><br /></code></code></div>
<br />
<span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;">導入できました。</span></span><br />
<span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;"><br /></span></span>
<span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;">で</span></span><br />
<span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;"><br /></span></span>
<br />
<blockquote class="tr_bq">
<span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;">$ nova-manage service list</span></span><span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;"><br /></span></span>Binary Host Zone Status State Updated_At<br />
nova-compute node01 nova enabled :-) 2012-12-27 14:15:09<br />
nova-cert controller nova enabled :-) 2012-12-28 05:47:31<br />
nova-compute controller nova enabled :-) 2012-12-27 14:14:22<br />
nova-scheduler controller nova enabled :-) 2012-12-28 05:47:31<br />
nova-consoleauth controller nova enabled :-) 2012-12-28 05:47:30</blockquote>
<span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;"><br /></span></span>
<span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;"><br /></span></span>
<span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;"><br /></span></span>
<span style="font-family: Consolas, Liberation Mono, Courier, monospace;"><span style="font-size: 12px;"><br /></span></span>
<code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"><br /></code>
<code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"><br /></code>
<code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"><br /></code>
<code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"><br /></code>
<code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"><br /></code>
<code style="background-color: transparent; border-bottom-left-radius: 3px; border-bottom-right-radius: 3px; border-top-left-radius: 3px; border-top-right-radius: 3px; border: none; font-family: Consolas, 'Liberation Mono', Courier, monospace; font-size: 12px; margin: 0px; padding: 0px;"><br /></code></div>
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-72066954700287123162012-11-07T04:01:00.002+09:002012-11-07T04:18:31.643+09:00データ保存 その2つづき
ちょこちょこと訂正を加えた。とりあえずUISegmentedControll(_timeSegmanet)を加えた。
<pre class="prettyprint">
- (void)save{
NSMutableArray *myMuArray = [NSMutableArray array];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
// 保存されているデータがあるかないか判断
if ([[[NSUserDefaults standardUserDefaults] arrayForKey:@"ARRAY"] count] > 0) { // あれば呼び込む
NSArray *array = [[NSUserDefaults standardUserDefaults] arrayForKey:@"ARRAY"];
myMuArray = [[NSMutableArray alloc] initWithArray:array];
NSLog(@"myMuArray is %@",[myMuArray description]);
}
//日時の書式を作成
NSDate *nowDate = [NSDate date];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy/MM/dd "];
//日付型をString型にする
NSString *dateString = [formatter stringFromDate:nowDate];
if (_timeSegment.selectedSegmentIndex == 0) {
[dict setValue:@"ASA" forKey:@"TIME"];
}else if(_timeSegment.selectedSegmentIndex == 1){
[dict setValue:@"HIRU" forKey:@"TIME"];
}else if(_timeSegment.selectedSegmentIndex == 2){
[dict setValue:@"YORU" forKey:@"TIME"];
}
[dict setValue:dateString forKey:@"DATE"];
[dict setValue:hozontfd.text forKey:@"HINMOKU"];
// 新しい値を配列に追加
[myMuArray addObject:dict];
// 値を保存
[[NSUserDefaults standardUserDefaults] setObject:myMuArray forKey:@"ARRAY"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
</pre>
myMuArrayの出力結果は、
<pre class="prettyprint">
myMuArray is (
{
DATE = "2012/11/07 ";
HINMOKU = 77;
TIME = ASA;
},
{
DATE = "2012/11/07 ";
HINMOKU = 7;
TIME = ASA;
},
{
DATE = "2012/11/07 ";
HINMOKU = 733;
TIME = YORU;
}
)
</pre>
出力結果の「\U5e」なんだ?と思ったら「年[スペース]」か。これはスラッシュでいいなぁと思い修正。
出力結果の構造的に理想とは違うのかな?
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-41467016600595788202012-11-06T22:42:00.002+09:002012-11-07T04:04:28.289+09:00データ保存についてNSDictionaryとNSUserDefaultを使用してデータを保存します。<br />
<br />
目標
<br />
<pre class="prettyprint">
①日付、②品目数(朝or昼or夜)をセルのカスタマイズを使って表示させることです。
1、dictionary、NSUserDefaultsを使って
①日付
②品目数
③品目数
④品目数
を格納、保存
</pre>
です。
現在の状況は、とりあえずコードベタ張りするとこんな感じ。
<pre class="prettyprint">
//seguの処理
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// 遷移先を取得
if ([[segue identifier] isEqualToString:@"ponSegue"]) {
TableViewController *tableViewController = segue.destinationViewController;
//追加 日時の表記を変える
//日時の書式を作成
nowDate = [NSDate date];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy年 MM/dd "]; //HH:mm
//日付型をString型にする
NSString *dateString = [formatter stringFromDate:nowDate];
// NSMutableArrayの生成
NSMutableArray* myMuArray = [NSMutableArray array];
//日付を入れる配列用意
NSMutableArray* myDateString = [NSMutableArray array];
// 保存されているデータがあるかないか判断
if ([[[NSUserDefaults standardUserDefaults]
arrayForKey:@"ARRAY"] count] > 0) { // あれば呼び込む
//NSarrayで取り出す (これじゃないとNSUserDefaultsから取り出せない)
NSArray *array = [[NSUserDefaults standardUserDefaults]
arrayForKey:@"ARRAY"];
//NSMutableArrayに格納
myMuArray = [[NSMutableArray alloc] initWithArray:array];
NSLog(@"myMuArray is %@",[myMuArray description]);
}
// 新しい値を配列に追加
[myDateString addObject:dateString];
[myMuArray addObject:hozontfd.text];
//大きな配列全体の保存
saveArray = [[NSMutableArray alloc] initWithCapacity:1];
//dictionaryにそれぞれの要素を入れる
NSMutableDictionary *dict = [[NSMutableDictionary alloc] initWithCapacity:1];
[dict setObject:myDateString forKey:@"Date"];
[dict setObject:myMuArray forKey:@"MuArray"];
//これでまとめて保存
[saveArray addObject:dict];
// 値を保存
[[NSUserDefaults standardUserDefaults] setObject:saveArray forKey:@"ARRAY"];
[[NSUserDefaults standardUserDefaults] synchronize];
tableViewController.myMuArray2 =saveArray;
tableViewController.hinmoku = myMuArray;
tableViewController.hiduke = myDateString;
}
}
</pre>
ふむ、、、おかしいですねー。
出力結果が、(朝1日分のみですが^^;;)
<pre class="prettyprint">
{
Date = (
"2012\U5e74 11/06 "
);
MuArray = (
12
);
}
)
</pre>
思うようなデータが入ってないっすねー。
理想は、
<pre class="prettyprint">
{
Date = "日付"
Asa = "数字"
Hiru = "数字"
Yoru = "数字"
},{
Date = "日付"
Asa = "数字"
Hiru = "数字"
Yoru = "数字"
}
</pre>
ですかねー。違うかもしれんけど^^;;
長くなったので次回
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-88097094226559493652012-11-06T01:12:00.001+09:002012-11-06T01:14:05.255+09:00nested push animation can result in corrupted navigation bar<pre class="prettyprint">
nested push animation can result in corrupted navigation bar
Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
Unbalanced calls to begin/end appearance transitions for <TableViewController: 0x6b69d00>.
</pre>
このエラーに引っかかった。
まぁそのままんまですが、解決するまですごく時間かかった。
<a href="http://d.hatena.ne.jp/heppokose/20120622/1340332007">こいつ</a>とかみたらいんですかねー。
で、どんな感じで書いてたかと
<pre class="prettyprint">
//ボタンを押したときの処理
- (IBAction)btnact:(id)sender {
//seguのIDを設定 (送り先のViewに値を渡すため・・・)
[self performSegueWithIdentifier:@"ponSegue" sender:self];
}
//seguの処理
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// 遷移先を取得
if ([[segue identifier] isEqualToString:@"ponSegue"]) {
}
}
</pre>
こういう感じです。違和感なかったです(汗)もちろん、storyboardの方も設定してますよ。
解決方法はというと、
<pre class="prettyprint">
//ボタンを押したときの処理
- (IBAction)btnact:(id)sender {
// ここいらない
}
//seguの処理
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// 遷移先を取得
if ([[segue identifier] isEqualToString:@"ponSegue"]) {
}
}
</pre>
以上でーす。
おそらくボタンからの画面遷移をstoryboardで設定してたからでしょうね(伝わってる??)
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-36957219563101076062012-11-05T00:34:00.003+09:002012-11-05T14:44:24.277+09:00<br />
とりあえず簡単なのでデータをNSUserdDefaultsで保存する。<br />
<br />
参考URLは下記<br />
NSUserDefaultsはどこまで保存できるかチェック(1)<br />
<a href="http://iphone-dev.g.hatena.ne.jp/tokorom/20090520/1242789479" target="_blank">http://iphone-dev.g.hatena.ne.jp/tokorom/20090520/1242789479</a><br />
<br />
画面遷移するときに保存させればいいかなと<br />
<pre class="prettyprint">
//segu<span class="s1">の処理</span>
-(<span class="s2">void</span>) prepareForSegue:(<span class="s3">UIStoryboardSegue</span> *)segue sender:(<span class="s2">id</span>)sender<br />
{<br />
<span class="s4"> </span>// <span class="s1">遷移先を取得</span><span class="s4"> </span>
<span class="s2">if</span><span class="s4"> ([[segue </span>identifier<span class="s4">] </span>isEqualToString<span class="s4">:</span><span class="s5">@"ponSegue"</span><span class="s4">]) {</span> <br />
<span class="s6">TableViewController</span> *tableViewController = segue.<span class="s3">destinationViewController</span>;<br />
tableViewController.<span class="s6">kazu</span> = <span class="s6">hozontfd</span>.<span class="s3">text</span>;
<span class="s7">//</span><span class="s8">テキストフィールドに書かれた値を</span><span class="s7">kazu</span><span class="s8">に</span><span class="s4"> </span>
// tableViewController.myMuArray = array;
// NSMutableArray<span class="s1">の生成</span><span class="s4"> </span>
NSMutableArray<span class="s4">* myMuArray = [</span>NSMutableArray<span class="s4"> </span><span class="s9">array</span><span class="s4">];</span><span class="s10"> </span>
<span class="s11">// </span>保存されているデータがあるかないか判断<br />
<span class="s4"> </span><span class="s2">if</span><span class="s4"> ([[[</span><span class="s3">NSUserDefaults</span><span class="s4"> </span>standardUserDefaults<span class="s4">] </span>arrayForKey<span class="s4">:</span><span class="s5">@"ARRAY"</span><span class="s4">] </span>count<span class="s4">] == </span><span class="s12">0</span><span class="s4">) {</span>
<span class="s7">// </span><span class="s8">あれば呼び込む</span><span class="s4"> </span>
<span class="s3">NSArray</span><span class="s4"> *array = [[</span><span class="s3">NSUserDefaults</span><span class="s4"> </span>standardUserDefaults<span class="s4">] </span>arrayForKey<span class="s4">:</span><span class="s5">@"ARRAY"</span><span class="s4">];</span><span class="s4"> </span>
<span class="s4"> </span>// NSMutableArray<span class="s1">に格納</span> myMuArray = [[<span class="s3">NSMutableArray</span> <span class="s9">alloc</span>] <span class="s9">initWithArray</span>:array];
<span class="s9">NSLog</span>(<span class="s5">@"myMuArray is %@"</span>,[myMuArray <span class="s9">description</span>]);<br />
}<br />
<br />
<span class="s4"> </span>// <span class="s1">新しい値を配列に追加</span>
[myMuArray <span class="s9">addObject</span>:<span class="s6">hozontfd</span>.<span class="s3">text</span>]
<span class="s7">// </span><span class="s8">値を保存</span><span class="s4"> </span>
<span class="s4">[[</span><span class="s3">NSUserDefaults</span><span class="s4"> </span>standardUserDefaults<span class="s4">] </span>setObject<span class="s4">:myMuArray </span>forKey<span class="s4">:</span><span class="s5">@"ARRAY"</span><span class="s4">];</span><span class="s4"> </span>
<span class="s4"> [[</span><span class="s3">NSUserDefaults</span><span class="s4"> </span>standardUserDefaults<span class="s4">] </span>synchronize<span class="s4">];</span> <br />
}<br />
<br />
}
<br />
<br />
</pre>
<br />
注意しなければいけないところは、<br />
NSUserDefaultsではNSMutableArrayを取り出せないこと。そもそもこんな感じで活用することを想定していないからかなー。<br />
取り出そうとするとこんなかんじのエラーが、、、<br />
<a href="http://sickleweasel.cocolog-nifty.com/blog/2011/03/mutating-method.html" target="_blank">mutating method sent to immutable object</a><br />
<br />
だからNSArrayで呼び込んで、NSMutableArrayに格納し直すという手間がかかる。<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-29307074493115763932012-10-30T14:51:00.002+09:002012-10-30T14:51:52.517+09:00keystone-manage db_syncエラー<br />
<br />
<br />
Traceback (most recent call last):<br />
File "/usr/bin/keystone-manage", line 28, in <module></module><br />
cli.main(argv=sys.argv, config_files=config_files)<br />
File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 148, in main<br />
return run(cmd, (args[:1] + args[2:]))<br />
File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 134, in run<br />
return CMDS[cmd](argv=args).run()<br />
File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 36, in run<br />
return self.main()<br />
File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 55, in main<br />
driver = utils.import_object(getattr(CONF, k).driver)<br />
File "/usr/lib/python2.7/dist-packages/keystone/common/utils.py", line 60, in import_object<br />
__import__(import_str)<br />
TypeError: __import__() argument 1 must be string, not None<br />
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-25231878206604230842012-10-29T15:00:00.000+09:002012-10-29T15:00:00.314+09:00メモ<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">openstackについて </span><a class="twitter-timeline-link" data-expanded-url="http://bit.ly/R63JIU" dir="ltr" href="http://t.co/Y93FXRP4" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;" target="_blank" title="http://bit.ly/R63JIU"><span class="invisible" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 0px; line-height: 0; text-decoration: none;">http://</span><span class="js-display-url" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;">bit.ly/R63JIU</span><span style="color: #038543; font-family: Helvetica Neue, Arial, Hiragino Kaku Gothic Pro, Meiryo, MS PGothic, sans-serif;"><span class="invisible" style="background-color: whitesmoke; font-size: 0px; line-height: 0; line-height: 0;"></span></span><span class="tco-ellipsis" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span></span></a><br />
<br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">サーバー管理ツール「Juju」向けのWeb UI「Juju GUI」、OpenStackクラウドの実装や管理にも対応 - SourceForge.JP Magazine : オープンソースの話題満載 </span><a class="twitter-timeline-link" data-expanded-url="http://sourceforge.jp/magazine/12/10/17/2129216" dir="ltr" href="http://t.co/2SRG907m" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;" target="_blank" title="http://sourceforge.jp/magazine/12/10/17/2129216"><span class="invisible" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 0px; line-height: 0; text-decoration: none;">http://</span><span class="js-display-url" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;">sourceforge.jp/magazine/12/10</span><span class="invisible" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 0px; line-height: 0; text-decoration: none;">/17/2129216</span><span class="tco-ellipsis" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span>…</span></a><br />
<br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">memcached </span><a class="twitter-timeline-link" data-expanded-url="http://bit.ly/ijIr6T" dir="ltr" href="http://t.co/Ka4cuVpl" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;" target="_blank" title="http://bit.ly/ijIr6T"><span class="js-display-url" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">bit.ly/ijIr6T</span><span style="color: #038543; font-family: Helvetica Neue, Arial, Hiragino Kaku Gothic Pro, Meiryo, MS PGothic, sans-serif;"><span class="invisible" style="background-color: whitesmoke; font-size: 0px; line-height: 0; line-height: 0;"></span></span><span class="tco-ellipsis" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span></span></a><br />
<br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">なにこれ? サブプロセス インストール済みの post-installation スクリプト はエラー終了ステータス 1 を返しました</span><br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;"><br /></span>
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">rabbitMQ </span><a class="twitter-timeline-link" data-expanded-url="http://bit.ly/PeXLH1" dir="ltr" href="http://t.co/RuacKiwL" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;" target="_blank" title="http://bit.ly/PeXLH1"><span class="invisible" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 0px; line-height: 0; text-decoration: none;">http://</span><span class="js-display-url" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;">bit.ly/PeXLH1</span><span style="color: #038543; font-family: Helvetica Neue, Arial, Hiragino Kaku Gothic Pro, Meiryo, MS PGothic, sans-serif;"><span class="invisible" style="background-color: whitesmoke; font-size: 0px; line-height: 0; line-height: 0;"></span></span><span class="tco-ellipsis" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span></span></a><br />
<br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">apt-get でインスコできなかったので wget でインスコする。後は下記を試す。 </span><a class="twitter-timeline-link" data-expanded-url="http://bit.ly/RHtUTx" dir="ltr" href="http://t.co/w0UxkhNd" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;" target="_blank" title="http://bit.ly/RHtUTx"><span class="invisible" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 0px; line-height: 0; text-decoration: none;">http://</span><span class="js-display-url" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;">bit.ly/RHtUTx</span><span style="color: #038543; font-family: Helvetica Neue, Arial, Hiragino Kaku Gothic Pro, Meiryo, MS PGothic, sans-serif;"><span class="invisible" style="background-color: whitesmoke; font-size: 0px; line-height: 0; line-height: 0;"></span></span><span class="tco-ellipsis" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span></span></a><br />
<br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">erlang-noxってのはなんだ。並行処理指向のerlangってのはプログラミング言語のことらしいな。</span><br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;"><br /></span>
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">/var/cache/apt/archives</span><span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">にパッケージファイルたちがあるのかー。勉強になります。</span><br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;"><br /></span>
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">ERROR: epmd error for host "149": timeout (timed out establishing tcp connection) </span><a class="twitter-timeline-link" data-expanded-url="http://bit.ly/XyplyX" dir="ltr" href="http://t.co/2WPPmbHT" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;" target="_blank" title="http://bit.ly/XyplyX"><span class="invisible" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 0px; line-height: 0; text-decoration: none;">http://</span><span class="js-display-url" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;">bit.ly/XyplyX</span><span style="color: #038543; font-family: Helvetica Neue, Arial, Hiragino Kaku Gothic Pro, Meiryo, MS PGothic, sans-serif;"><span class="invisible" style="background-color: whitesmoke; font-size: 0px; line-height: 0; line-height: 0;"></span></span><span class="tco-ellipsis" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span></span></a><br />
<br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">127.0.0.1 yourhostnameで解決。これで本当にいいのだろうか、、、</span><a class="twitter-timeline-link" data-expanded-url="http://bit.ly/R8n1x6" dir="ltr" href="http://t.co/zN6S1EYr" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;" target="_blank" title="http://bit.ly/R8n1x6"><span class="invisible" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 0px; line-height: 0; text-decoration: none;">http://</span><span class="js-display-url" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;">bit.ly/R8n1x6</span><span style="color: #038543; font-family: Helvetica Neue, Arial, Hiragino Kaku Gothic Pro, Meiryo, MS PGothic, sans-serif;"><span class="invisible" style="background-color: whitesmoke; font-size: 0px; line-height: 0; line-height: 0;"></span></span><span class="tco-ellipsis" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span></span></a><br />
<br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">keystone-manage db_syncでエラー発生</span><br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;"><br /></span>
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">メモ:</span><a class="twitter-timeline-link" data-expanded-url="http://bit.ly/UhWv75" dir="ltr" href="http://t.co/xeTvfhcB" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;" target="_blank" title="http://bit.ly/UhWv75"><span class="invisible" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 0px; line-height: 0; text-decoration: none;">http://</span><span class="js-display-url" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;">bit.ly/UhWv75</span><span style="color: #038543; font-family: Helvetica Neue, Arial, Hiragino Kaku Gothic Pro, Meiryo, MS PGothic, sans-serif;"><span class="invisible" style="background-color: whitesmoke; font-size: 0px; line-height: 0; line-height: 0;"></span></span><span class="tco-ellipsis" style="background-color: whitesmoke; color: #038543; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px; text-decoration: none;"><span class="invisible" style="font-size: 0px; line-height: 0;"> </span></span></a><br />
<br />
<span style="background-color: whitesmoke; color: #333333; font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic Pro', Meiryo, 'MS PGothic', sans-serif; font-size: 14px; line-height: 18px;">sheepdogって、再起動したら共有したディレクトリ自体がさよならしてしまうのね。 中のvdiだけがさよならすると思っててめっちゃハマったわw</span>Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-44647017147051701332012-10-15T03:29:00.005+09:002012-10-15T03:29:58.362+09:00Rubyを勉強するというわけで、dotcloudかherokuで悩んだんだけど<br />
dotcloudはpythonでherokuはRubyみたいな感じだったのでherokuに<br />
<br />
別にその言語だけ使えるわけではないけど。<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-24324199626371831722012-09-10T16:06:00.004+09:002012-09-10T16:06:59.368+09:00devstackでちょっとした理由でOpenStackを導入しないと行けないんですが、<div>
難しいT_T</div>
<div>
<br /></div>
<div>
自分の知識のなさ。これまでの大学生活で学んだことを全て忘れとる^^;;</div>
<div>
<br /></div>
<div>
というわけで、少し勉強もしつつ導入しようとしてるんですが、一向に光がみえん。</div>
<div>
<br /></div>
<div>
そんな中、色々調べてるとdevstackを言うものがあるらしいので少し試してみたら動きました。</div>
<div>
<br /></div>
<div>
しかし、1台でしか動かん。。。クラウドの意味ねー。</div>
<div>
<br /></div>
<div>
てな感じでもう少し頑張ります。</div>
<div>
<br /></div>
<div>
ドキュメントが英語だとヤル気が…(そんなこと言ってる場合じゃねー)</div>
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-31271242626000044762012-09-07T19:33:00.000+09:002012-09-07T19:33:01.638+09:00MacBookPro13購入
<br />
<div class="p1">
現在導入したアプリ</div>
<div class="p1">
========</div>
<div class="p1">
google chrome</div>
<div class="p1">
google日本語入力</div>
<div class="p1">
夜フクロウ</div>
<div class="p1">
Xcode</div>
<div class="p1">
coda2</div>
<div class="p1">
iterm2</div>
<div class="p1">
evernote</div>
<div class="p1">
dropbox</div>
<div class="p1">
alfred</div>
<div class="p1">
clamxav</div>
<div class="p1">
xtrafinder</div>
<div class="p1">
skitch</div>
<div class="p1">
homebrew</div>
<div class="p1">
cotediter</div>
<div class="p1">
eclipse</div>
<div class="p1">
==========</div>
<div class="p1">
導入するアプリメモ</div>
<div class="p1">
hackapp</div>
<div class="p1">
appcleaner</div>
<div class="p1">
skype</div>
<div class="p1">
eve</div>
<div class="p1">
tex</div>
<div class="p1">
pogoplug</div>
<div class="p1">
magican</div>
<div class="p1">
rubyインストールするやつ名前忘れた</div>
<div class="p1">
========</div>
<div class="p1">
todo</div>
<div class="p1">
vimのカスタマイズ</div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
基本的に開発環境の整備をしっかりしたい。</div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
<div class="p1">
<br /></div>
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-47462098226628524572012-09-05T15:18:00.001+09:002012-09-05T15:18:08.665+09:00ルーター変えた家のルーター変えた。<br />
<br />
今までのは先輩のお下がりだったからな。<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://2.bp.blogspot.com/-NL_2Bx4tTp0/UEbtdNaWsnI/AAAAAAAAAH4/9SUv2plbnpQ/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-09-05+13.31.49.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="186" src="http://2.bp.blogspot.com/-NL_2Bx4tTp0/UEbtdNaWsnI/AAAAAAAAAH4/9SUv2plbnpQ/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-09-05+13.31.49.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">今までの </td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="http://4.bp.blogspot.com/-rJrpUWrZLpE/UEbtgEAgWFI/AAAAAAAAAII/9gFrXCO6BQY/s1600/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-09-05+15.11.50.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="183" src="http://4.bp.blogspot.com/-rJrpUWrZLpE/UEbtgEAgWFI/AAAAAAAAAII/9gFrXCO6BQY/s320/%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88+2012-09-05+15.11.50.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">変更したの<br /></td></tr>
</tbody></table>
いやー嬉しいな。下りしか載せてないけど当然上りも早くなった。<br />
<br />
買ったのは価格.comで上位に入ってた<br />
<br />
<h2 style="background-color: white; border-bottom-style: none; clear: both; color: #333333; font-family: 'MS Pゴシック', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', Osaka, arial, verdana, sans-serif; font-size: 20px; line-height: 22px; margin: 0px; padding: 0px 3px 2px;">
AirStation NFINITI HighPower Giga WZR-HP-G302H/N</h2>
<div>
http://kakaku.com/item/K0000395040/</div>
<div>
<br /></div>
<div>
やはりPCまわりのものは最新のものにしておくのがストレスがなくていいんじゃないかと思う。</div>
<div>
<br /></div>
<div>
あと、なぜルータ変えようかと思ったかというとpogoplug使ってるからアクセス早くなるんじゃね??(しらないけど)となんとなく思ったから</div>
<div>
もう一つは、新しいMBPを購入したから</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-4094972600631764202012-09-01T00:38:00.002+09:002012-09-01T00:38:27.408+09:00Androidアプリを作る。<br />
<br />
真剣に取り組んでいたのがObjective-Cしかない。<br />
<br />
Java頑張る。<br />
難しいけど、けっこうたのしいし理解が深まる。Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-5962697679774825182011-11-29T13:40:00.001+09:002011-11-29T13:48:06.645+09:00ライブマイグレーションいつになったらやれるのか。。。virt-managerを用いてライブマイグレーションを行いたいのだがうまくできない.<br />
<br />
migrateというボタンを押すだけなはず<br />
<br />
で、エラーは↓↓<br />
<b style="background-color: white;"><i><span id="aeaoofnhgocdbnbeljkmbjdmhbcokfdb-mousedown" style="font-size: medium;">Unable to migrate guest:</span><br /><span style="font-size: medium;"> Traceback (most recent call last):</span><br /><span style="font-size: medium;"> File "/usr/share/virt-manager/virtManager/migrate.py", line 453, in _async_migrate</span><br /><span style="font-size: medium;"> vm.migrate(dstconn, migrate_uri, rate, live, secure)</span><br /><span style="font-size: medium;"> File "/usr/share/virt-manager/virtManager/domain.py", line 230, in migrate</span><br /><span style="font-size: medium;"> self._backend.migrate(destconn.vmm, flags, newname, interface, rate)</span><br /><span style="font-size: medium;"> File "/usr/lib/python2.6/dist-packages/libvirt.py", line 429, in migrate</span><br /><span style="font-size: medium;"> if ret is None:raise libvirtError('virDomainMigrate() failed', dom=self)</span><br /><span style="font-size: medium;">libvirtError: monitor socket did not show up.: Connection refused</span></i></b><br />
<b style="background-color: white;"><i><span style="font-size: medium;"><br /></span></i></b><br />
<b style="background-color: white;"><i><span style="font-size: medium;"><a href="https://www.redhat.com/archives/libvirt-users/2011-April/msg00004.html" target="_blank">https://www.redhat.com/archives/libvirt-users/2011-April/msg00004.html</a></span></i></b><br />
上記のURLと同じエラーをはいているんだよ.しかも、結局解決されていない.<br />
<b style="background-color: white;"><i><br /></i></b><br />
<br />
先生からubuntuのバージョンをあげてみろとのアドバイスを受けたのでやってみるがそれでうまくいくのかは疑問.<br />
<br />
んー知識不足で原因をつかめないのは結構辛いなぁ.<br />
<br />
<br />
スペックは以下<br />
ubuntu desktop 10.04<br />
メモリ:3GB<br />
virt-manager 0.7.5.5<br />
libvirt-bin ??<br />
*はてなは後で埋める<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-986018953808473272011-11-24T23:58:00.001+09:002011-11-25T00:43:05.165+09:00pogoplug メモpogoplugにmovファイルをアップロードしようとするとエラーがでる.<br />
<br />
コンバーターは有料…どうしたものか<br />
<br />
QuickTime Playerを使用してデスクトップをキャプチャーしてみたんですけどねー.<br />
<br />
movファイルになるなんて知りませんでした.(というか拡張子movを初めて知りました…お恥ずかしい)<br />
<br />
デスクトップをキャプチャーする方法他にあるのか探す必要があるな.<br />
<br />
追記<br />
<br />
なんかできました.pogoplug ソフトウェアを使用.NASでやりました.<br />
<br />
まだ色々と不安定な部分があるのかな??Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-54430528999051203492011-11-02T19:23:00.002+09:002011-11-02T19:23:16.138+09:00ブリッジ接続<br />
#!/bin/sh<br />
<br />
sudo ifconfig eth0 0.0.0.0 promisc up<br />
sudo brctl addbr br0<br />
sudo brctl addif br0 eth0<br />
sudo ifconfig br0 up<br />
sudo ifconfig br0 192.168.0.128 netmask 255.255.255.0<br />
sudo route add default gw 192.168.0.1<br />
<div>
<br /></div>
<div>
どん!!</div>Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-51264980989950264742011-11-02T19:22:00.001+09:002011-11-03T00:00:56.418+09:00virt-install ハマってる…<br />
#!/bin/sh<br />
<br />
sudo virt-install \<br />
--connect qemu:///system \<br />
--name vmubuntu01 \<br />
--ram 512 \<br />
--file /var/lib/libvirt/images/vmubuntu01.img \<br />
--file-size 5 \<br />
--nographics \<br />
--paravirt \<br />
--location http://rsync.atworks.co.jp/centos/6/os/i386/ \<br />
--accelerate \<br />
--network bridge=br0 \<br />
--keymap ja \<br />
--vcpus=2 \<br />
--virt-type kvm \<br />
--extra-args 'console=tty0 onsole=ttyS0,115200n8'<br />
<div>
<br /></div>
<div>
なにが悪い…</div>
<div>
<br /></div>
<div>
ubuntu serverうまく入らないからCentOSにしたがあまり変化なし。</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<div>
Starting install...</div>
<div>
ファイル .treeinfo を読出中... | 720 B 00:00 ... </div>
<div>
ファイル vmlinuz を読出中... | 7.0 MB 00:00 ... TA </div>
<div>
ファイル initrd.img を読出中... | 55 MB 00:04 ... ETA </div>
<div>
ドメインを作成中... | 0 B 00:00 </div>
<div>
Connected to domain vmubuntu01</div>
<div>
エスケープ文字は ^] です</div>
</div>
<div>
<br /></div>
<div>
・・・ここで止まる</div>
<div>
<br /></div>
<div>
OSがインストールされない.</div>
<div>
vncで接続したらいいのか??</div>
<div>
<br /></div>
<div>
これだとテキストモードでインストール開始されるはずなんだけど…<br />
<br />
<br />
そしてドメイン削除後もう一度シェルを実行すると<br />
<br />
ERROR Host does not support virtualization type 'xen'<br />
<div>
<br /></div>
<div>
なぜだ!!</div>
<br />
=========================================追記<br />
<br />
kvmは完全仮想化ソフトらしい。<br />
つまり、 --paravirtではない!!<br />
<br />
<br />
sudo virt-install --nographics --prompt --virt-type kvm --hvm --extra-args 'console=tty0 console=ttyS0,115200n8' --location http://rsync.atworks.co.jp/centos/6/os/i386/<br />
<br />
これではうまく行った.けど、インストール失敗した…<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-29105317171359555022011-10-04T19:52:00.001+09:002011-10-04T19:52:07.576+09:00kvmkvmよくわからん。<br />
まぁこいつでいける。<br />
<br />
<blockquote>
sudo kvm -m 512 -cdrom /dev/cdrom -hda vm-ubuntu.img -boot d -k ja</blockquote>
<div>
-m:メモリ</div>
<div>
-cdrom:<span class="Apple-style-span" style="background-color: white; font-family: tahoma, arial, sans-serif;">インストールISOファイルをCD-ROMドライブとしてアタッチします</span></div>
<div>
<span class="Apple-style-span" style="font-family: tahoma, arial, sans-serif;">-hda:仮想ハードディスク</span></div>
<div>
<span class="Apple-style-span" style="font-family: tahoma, arial, sans-serif;">-boot:CD-ROMからブートする</span></div>
<div>
<span class="Apple-style-span" style="font-family: tahoma, arial, sans-serif;">-k:キーボード配列</span></div>
<div>
<span class="Apple-style-span" style="font-family: tahoma, arial, sans-serif;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: tahoma, arial, sans-serif;">-kをつけてないことによりキーボード配列がおかしくなりはまった.</span></div>
<div>
<span class="Apple-style-span" style="font-family: tahoma, arial, sans-serif;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: tahoma, arial, sans-serif;">二回目からは-boot と -cdromを省く</span></div>
Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-2471128383574951632011-10-04T19:45:00.000+09:002011-10-04T19:45:05.498+09:00sshの設定などなんとなく。公開鍵認証もわかってきた。<br />
<br />
一回作ればそれを使いまわせばいいのだな。<br />
<br />
だから、以下のコマンドでホストサーバーに公開鍵<br />
の情報を渡しておけばいいのだ。<br />
<blockquote>
<span class="Apple-style-span" style="background-color: white; color: #444444; font-family: monospace; font-size: 13px; line-height: 21px;">$ cd /home/<ユーザー名>/.ssh</span><span class="Apple-style-span" style="background-color: white; color: #444444; font-family: monospace; font-size: 13px; line-height: 21px;">$ cp <任意の場所>/id_rsa.pub authorized_keys </span><span class="Apple-style-span" style="background-color: white; color: #444444; font-family: monospace; font-size: 13px; line-height: 21px;">$ chmod 600 authorized_keys</span></blockquote>
<br />
<blockquote>
<span class="Apple-style-span" style="background-color: white; color: #444444; font-family: monospace; font-size: 13px; line-height: 21px;">$ cat id_rsa.pub >> authorized_keys</span></blockquote>
をやると追加されるっぽい…(よくわかってない)<br />
<br />
あと、設定の参考に<br />
<a href="http://clown-do.ddo.jp/index.php?id=475">http://clown-do.ddo.jp/index.php?id=475</a><br />
をみる。Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0tag:blogger.com,1999:blog-1080682361641353530.post-30064445133488800622011-04-26T10:03:00.003+09:002011-04-26T10:05:19.765+09:00絶対に参考になるiphoneアプリのオープンソース群これは絶対に参考になるしライブラリとして自分のアプリに入れることも可能だろう。<br /><br />iPhoneアプリを開発している人は絶対にみたほうがいい。<br /><br />Mac OS Xのもあるのかな??そこはよくわからない。<br /><br /><a href="http://cocoacontrols.com/">Custom UI Component Database for iOS and Mac OS X</a>Anonymoushttp://www.blogger.com/profile/04440089255579206701noreply@blogger.com0