2011년 12월 11일 일요일

centos 5.6에 intel wireless 2200BG 세팅


centos 5.6의 intel 2200BG 무선을 잡기 위해서는  ieee80211 subsystem을 리눅스 커널에 설치하여야 한다.
ieee80211-1.0.1.tgz를 다운받아 설치한다.

http://ieee80211.sourceforge.net/
#tar xzvf ieee80211-1.0.1.tgz#less ieee80211-1.0.1/INSTALL

설치후 2200BG 펌웨어를 rpm으로 설치한다. 
http://rpms.arrfab.net/rpmforge/packages/repodata/repoview/ipw2200-firmware-0-3.0-3.el5.rf.html

#rpm -Uhv ipw2200-firmware-3.0-3.el5.rf.noarch.rpm 
#reboot
끝. 

2011년 10월 10일 월요일

구형 맥북에 Mac OS X 10.7 Lion 설치시 설치 종료 오류


MacBook을 포맷 후 Mac OS X 10.7 Lion을 부팅 CD를 이용하여 설치시 오류가 발생하였다.
이는 맥북의 메인보드 NARAM(비휘발성 메모리)이 라이언과 맞지 않아 발생하는 문제로 보인다.

NARAM 재설정 후 설치에 성공하였다.
1. 부팅 CD를 이용하여 재부팅.
2. option + command + r + p 키를 누른 상태로 전원을 켠다.
3. 계속 누른 상태로 기다리면 애플 로고가 뜨기 전에 자동으로 재부팅을 한다.
4. 리부팅 되었을때 누르고 있던 키에서 손을 뗍니다.
5. 설치를 진행.

Intel 기반 Mac의 시동 키 조합

시동 중 C 누르기컴퓨터와 함께 제공된 Mac OS X Install Disc와 같은 부팅 가능 CD 또는 DVD를 사용해 시동합니다.
시동 중 D 키 누르기AHT(Apple Hardware Test)에서 시동합니다.
경고음이 두 번 울릴 때까지 option-command-P-R 누르기NVRAM을 재설정합니다.
시동 중 option 키 누르기시작할 Mac OS X 볼륨을 선택할 수 있는 시동 관리자를 시작합니다. 참고: 첫 번째 부팅 가능 네트워크 볼륨도 표시되도록 하려면 N을 누릅니다.
추출, F12 키를 누르거나 마우스나 트랙패드 단추 누르기광학 디스크와 같은 이동식 미디어를 추출합니다.
시동 중 N 누르기호환되는 네트워크 서버(NetBoot)에서 시동합니다.
시동 중 T 누르기대상(Target) 디스크 모드에서 시동합니다.
시동 중 shift 키 누르기안전한 시동 모드로 시동하고 로그인 항목을 일시적으로 비활성화합니다.
시동 중 command-V 누르기상세(Verbose) 모드에서 시동합니다.
시동 중 command-S 누르기단일(Single) 사용자 모드에서 시동합니다.
시동 중 option-N 누르기기본 부팅 이미지를 사용하여 NetBoot Server에서 시동합니다.

추가 정보

시동 키를 가장 잘 사용하려면 시동음이 재생되는 즉시 키를 누릅니다.
NVRAM 또는 PRAM 재설정 시기
 

요약

Mac은 꺼져 있는 경우에도 아래 설명된 대로 배터리 문제가 없으면 특수한 메모리 영역에 특정 설정을 저장합니다.  Intel기반 Mac에서는 NVRAM이라고 하는 메모리에 저장되고, PowerPC 기반 Mac에서는 PRAM이라고 하는 메모리에 저장됩니다.NVRAM 또는 PRAM에 저장되는 내용은 다음과 같습니다.
  • 스피커 볼륨
  • 화면 해상도
  • 시동 디스크 선택
이러한 기능과 관련된 문제가 발생하는 경우 NVRAM 또는 PRAM을 재설정해야 할 수도 있습니다. 예를 들어, 시동 디스크 환경설정에 지정한 것과 다른 시동 디스크로 Mac을 시작하는 경우 또는 Mac 시작 시 "물음표" 아이콘이 표시되는 경우 NVRAM이나 PRAM을 재설정하면 도움이 될 수 있습니다.

2011년 6월 17일 금요일

.plist(property list) 데이터 입력과 읽기

Xcode 프로젝트에 .plist 파일을 추가한다. 
예제에서는 “data.plist”를 사용


다음으로 문서디렉토리에 .plist 경로를 생성한다.


NSError *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //1
NSString *documentsDirectory = [paths objectAtIndex:0]; //2
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"data.plist"]; //3

NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath: path]) //4
{
NSString *bundle = [[NSBundle mainBundle] pathForResource:@”data” ofType:@”plist”]; //5

[fileManager copyItemAtPath:bundle toPath: path error:&error]; //6
}
1) 경로의 리스트를 생성
2) 리스트로부터 문서 경로를 가져온다.
3) 전체 경로를 생성.
4) 파일이 존재하는 지 체크.
5) 번들 디렉토리에 만들었던 문서의 경로를 가져온다.
6) document directory에 번들 파일 경로를 복사한다.
데이터 읽기:
NSMutableDictionary *savedStock = [[NSMutableDictionary alloc] initWithContentsOfFile: path];

//load from savedStock example int value
int value;
value = [[savedStock objectForKey:@"value"] intValue];
[savedStock release];

데이터 쓰기:


NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile: path];
//here add elements to data file and write data to file
int value = 5;
[data setObject:[NSNumber numberWithInt:value] forKey:@”value”];

[data writeToFile: path atomically:YES];
[data release]
두가지를 기억:

1)  Xcode project 에 문서를 생성.
2) 앱을 최적화하기 위해서는 app종료 혹은 뷰 종료시 모든 데이터를 저장한다. applicationWillTerminate 인스턴스에 추가. 대용량 데이터라면 이 방법은 사용하지 않는게 좋다. 앱 종료시 오래 걸리고 종종 강제 종료가 발생한다.


iphone simulator document 경로 _ 사용자 -> 라이브러리 -> application Support -> iPhone Simulator -> iOS버전 -> Applications - > 앱의 일련번호 

2011년 6월 16일 목요일

json parser YAJL 세팅


Installing in XCode 4 (iOS)

  • Add YAJLiOS.framework to your project.
  • In Build Phases, make sure its listed in Link Binary With Libraries, along with:
    • CoreGraphics.framework
    • Foundation.framework
    • UIKit.framework
  • In Build Settings:
    • Under Framework Search Paths make sure the (parent) directory to YAJLiOS.framework is listed.
    • Under Other Linker Flags in your target, add -ObjC and -all_load
  • Import with #import <YAJLiOS/YAJL.h>.

2011년 6월 14일 화요일

mysql 5.5.13 설치시 cmake


mysql 5.x부터 설치 방법이 변경되었다.
./configure가 없고 cmake를 이용. ( gcc , g++ 설치 필요)

   # cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EXTRA_CHARSETS=all -DMYSQL_DATADIR=/usr/local/mysql/data -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DMYSQL_TCP_PORT=3306

# make && make install
# cp support-files/my-huge.cnf /etc/my.cnf            <---mysql 설정파일 복사
# cp support-files/mysql.server /etc/init.d/mysqld    <---mysql 실행데몬 복사     
# vi /etc/init.d/mysqld
--------------------------------------
datadir=/usr/local/mysql/data              
---------------------------------------
data디렉토리에서 파일 소유권을 mysql로 준다.
chown -R mysql:mysql *


# chmod 755 /etc/init.d/mysqld             <---mysql 데몬 실행 권한 부여
# chown -R mysql:mysql /usr/local/mysql              
# /usr/local/mysql/scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data                             <---DB생성
# /etc/init.d/mysqld start                     <---mysql 구동 (시작)  또는 /usr/local/server/mysql/bin/mysqld_safe &
# chkconfig --add mysqld                    
# /usr/local/mysql/bin/mysqladmin -u root password 암호        

mysql.sock오류 발생시 파일 확인. ( mysql.sock은 유닉스 소켓연결시 사용. )
bin 폴더에서 
#mysql_config --socket


mysql_config 없다고 메세지 발생시.

#sudo apt-get install libmysqlclient-dev


# ln -s /usr/local/mysql/bin/mysql /usr/bin/                           <---링크
# ln -s /usr/local/mysql/bin/mysqldump /usr/bin/

 3) mysql 접속

# mysql -u root -p                 <---mysql 접속
------------------------------------------------------------------------------------
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.10-log Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
---------------------------------------------------------------------------------------