The Pursuit of Happyness

반응형

@ 부팅할때 생기는 로그 확인하기

> dmesg 


@ 시스템 종료하기

> init 0
> shutdown -h -time 0 
> shutdown -r -time 0  (reboot)


@ 환경설정하기

> setup 


@ 네트워크 관리

> cd /etc/sysconfig/network-scripts/
> ifup eth0
> ifdown eth0 
> service network restart 

> cd /etc/sysconfig/network-scripts/
> vi ifcfg-eth0
# Xen Virtual Ethernet
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.167.255
HWADDR=7e:4c:b0:e1:2e:xx
IPADDR=192.168.167.x
NETMASK=255.255.255.0
NETWORK=192.168.167.0
ONBOOT=yes

> cd /etc/sysconfig/
> vi network
GATEWAY=192.168.167.1


@ DNS 세팅 

> vi /etc/resolv.conf

nameserver 4.2.2.1
nameserver 4.2.2.2


@ 부팅할때 실행할 서비스 관리

> ntsysv 


반응형

반응형
Cocos2D 는 MIT 라이센스로 배포되는 개발에 유용한 라이브러리 혹은 탬플릿 입니다.

먼저 아래 URL 에서 다운로드가 가능한데, 현재 1.0.1 버전이 다운로드 가능하며,

Cocos3D까지 배포가 되고 있습니다.

http://www.cocos2d-iphone.org/download


Document 탭에 들어가보면 설치 방법이 나와 있습니다.

http://www.cocos2d-iphone.org/wiki/doku.php/ 

Programming Guide > Lesson 1: Install + Start empty project

콘솔에서 설치 스크립트를 실행하면 설치가 되며, XCode 에 template 으로 추가되어 개발에 이용이 가능합니다.

참고로  iPhone 과 android 를 동시해 지원하는 cocos2d-x 버전도 있습니다.

http://www.cocos2d-x.org/ 

 
반응형

반응형

@ 준비물

아래 링크에서 적당한 버전의 Java SDK 다운로드 합니다.

http://www.oracle.com/technetwork/java/javase/downloads/index.html

 

아래 링크에서 적당한 버전의 eclipse 다운로드 합니다.

http://www.eclipse.org/downloads/

 

아래 링크에서ant 다운로드 합니다.

http://ant.apache.org/bindownload.cgi

 

아래 링크에서 jsch 다운로드 합니다.

http://www.jcraft.com/jsch/

 

@ 설치

Java default 폴더에 설치하는 것을 권장합니다.

eclipse My Document 압축을 풀면 됩니다.

ant eclipse 설치 경로 아래 있는 plugins 폴더에 압축을 풀어줍니다.

jsch ant 폴더 아래 있는 lib 폴더에 jar 파일만 추가합니다.

 

eclipse 실행합니다.

Window > Preferences > Ant > Runtime

Classpath 탭에 있는 Ant Home 버튼을 눌러서 압축을 ant 경로를 지정합니다.

반응형

반응형

If you ever need to completely remove Xcode due to application issues or future upgrades, you can run a single command from Terminal to remove it.

sudo /Developer/Library/uninstall-devtools --mode=all

Of course, /Developer is dependant on where you installed Xcode to.

반응형

반응형
반응형

반응형

import java.io.ByteArrayOutputStream;

import java.util.zip.Deflater;

import java.util.zip.Inflater;


public class ZipUtil {

public static final int BUF_SIZE = 1024;


public static ZipUtil instance = null;


private ZipUtil() {

}


public static ZipUtil getInstance() {

if (instance == null)

instance = new ZipUtil();

return instance;

}


public byte[] compress(byte[] input) {

if (input == null)

return null;


byte[] buf = new byte[BUF_SIZE];

ByteArrayOutputStream baos = new ByteArrayOutputStream();

Deflater def = new Deflater();

def.setInput(input);

def.finish();


try {

while (!def.finished()) {

int count = def.deflate(buf);

baos.write(buf, 0, count);

}

} catch (Exception e) {

e.printStackTrace();

} finally {

def.end();

}


return baos.toByteArray();

}


public byte[] decompress(byte[] input) {

if (input == null)

return null;


byte[] buf = new byte[BUF_SIZE];

ByteArrayOutputStream baos = new ByteArrayOutputStream();

Inflater inf = new Inflater();

inf.setInput(input);


try {

while (true) {

int count = inf.inflate(buf);

if (count > 0) {

baos.write(buf, 0, count);

} else if (count == 0 && inf.finished()) {

break;

} else {

throw new RuntimeException();

}

}

} catch (Exception e) {

e.printStackTrace();

} finally {

inf.end();

}


return baos.toByteArray();

}

}


반응형

반응형
Objective-C 에서 URL Encode 를 하는 경우 아래와 같이 사용합니다.

NSString * encodedString = (NSString *) CFURLCreateStringByAddingPercentEscapes (
NULL,  
(CFStringRef)unencodedString, 
NULL, 
(CFStringRef)@"!*'();:@&=+$,/?%#[]", 
kCFStringEncodingUTF8 );

참고로 Objective-C 에서 제공하는 stringByAddingPercentEscapesUsingEncoding 의 경우 "/", "=" 등이 encode 되지 않기 때문에 위의 방법을 사용하는 것이 안전합니다.
 
관련 정보는 http://choizak.tistory.com/69 에서 퍼왔습니다.

 
반응형

반응형

Create a copy of the table 

CREATE TABLE products_bak LIKE products

Copying the data from the original table to the new table

INSERT INTO products_bak SELECT * FROM products

Copying the data back again

TRUNCATE products;
INSERT INTO products SELECT * FROM products_bak

original link http://www.electrictoolbox.com/copy-table-mysql-create-table-like/


반응형

반응형
vi /etc/resolv.conf

nameserver 4.2.2.1
nameserver 4.2.2.2


반응형

반응형
echo "mail content" | mail -s "mail title" tistory@email.com
 
반응형