2012年12月20日 星期四

depoly inotify-tools error : Protected multilib versions: glibc-2.12-1.80.el6.i686 != glibc-2.12-1.80.el6_3.6.x86_64


depoly inotify-tools時出現以下error :

Error: Protected multilib versions: glibc-2.12-1.80.el6.i686 != glibc-2.12-1.80.el6_3.6.x86_64
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
glibc-common-2.12-1.80.el6_3.6.x86_64 is a duplicate with glibc-common-2.12-1.80.el6.x86_64
glibc-common-2.12-1.80.el6_3.6.x86_64 has missing requires of glibc = ('0', '2.12', '1.80.el6_3.6')

solution:

yum remove glibc-2.12-1.80.el6_3.6.x86_64
接著再install一次

SCOM linux agent deploy error : ssl certificate error

當deploy SCOM linux agent時,出現ssl certificate error時,refer以下網址

http://technet.microsoft.com/en-us/library/hh212851.aspx

另外如果安裝完成後執行出現access is  denied,為Run as account設定上面問題,refer

http://blogs.technet.com/b/kevinholman/archive/2012/03/18/deploying-unix-linux-agents-using-opsmgr-2012.aspx

search: run as account

2012年10月12日 星期五

Nginx搭配Apache做balance與proxy與避免ip直接訪問

#所有php的动态页面均交由apache处理
location ~ .(php)?$ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:88;
}
#所有静态文件由nginx直接读取不经过apache
location ~ .*.(htm|html|gif|jpg|jpeg|png|bmp|swf|ioc|rar|zip|txt|flv|mid|doc|ppt|pdf|xls|mp3|wma)$
{ expires 15d; }
location ~ .*.(js|css)?$
{ expires 1h; }
ref: (http://www.ha97.com/5119.html)

一些觀念
ref : (http://www.itlearner.com/article/4508)

實作補充
ref : (http://stackoverflow.com/questions/3434182/apache-and-ultimate-config-for-nginx-to-serve-all-virtual-hosts-in-the-right-way)

//避免直接ip訪問
在nginx/conf.d/default.conf裡加上並寫上自己對應的rewrite rule ex:http://yourdomain.com$request_uri?


server {
        listen 80 default_server;#ip
        server_name ip;
        rewrite ^ http://mrshih.com$request_uri?;
}






2012年9月12日 星期三

升級到xcode4.5後facebook sdk有遇到問題

問題如下

Ld /Users/shih/Library/Developer/Xcode/DerivedData/food-csyywpmvwokybxdzxglwpmdzfgug/Build/Intermediates/food.build/Debug-iphoneos/food.build/Objects-normal/armv7s/food normal armv7s
    cd /Users/shih/Desktop/food
    setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -L/Users/shih/Library/Developer/Xcode/DerivedData/food-csyywpmvwokybxdzxglwpmdzfgug/Build/Products/Debug-iphoneos -F/Users/shih/Library/Developer/Xcode/DerivedData/food-csyywpmvwokybxdzxglwpmdzfgug/Build/Products/Debug-iphoneos -F/Users/shih/Desktop/food/../../Documents/FacebookSDK -filelist /Users/shih/Library/Developer/Xcode/DerivedData/food-csyywpmvwokybxdzxglwpmdzfgug/Build/Intermediates/food.build/Debug-iphoneos/food.build/Objects-normal/armv7s/food.LinkFileList -dead_strip -lsqlite3.0 -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=5.0 -framework MapKit -framework MobileCoreServices -framework CoreLocation -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -framework FacebookSDK -o /Users/shih/Library/Developer/Xcode/DerivedData/food-csyywpmvwokybxdzxglwpmdzfgug/Build/Intermediates/food.build/Debug-iphoneos/food.build/Objects-normal/armv7s/food

ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/shih/Documents/FacebookSDK/FacebookSDK.framework/FacebookSDK for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)

解決辦法:

專案 => TARGET => Build Settings => Vaild Architectures => armv7 armv7s

把armv7 armv7s 改成 armv7








2012年9月2日 星期日

在storyboard下使用scroll view如何視覺化編輯畫面

1.
選擇controller的Inspector標籤
size屬性選擇Freeform

2.
選擇scroll view的Inspector標籤的右邊那個標籤
看到view那裏,編輯你要的width, height
接著就會看到storyboard上的controller的可編輯範圍出現變化了

3.
接著設計你的view
然後outlets scrollview的controller程式碼上,設定你在storyboard上的width, height

[self.sc setContentSize:CGSizeMake(320,600)];

DONE.

參考來源:
http://stackoverflow.com/questions/9288070/visually-arrange-subviews-in-a-large-uiscrollview